mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
v.pkgconfig: fix infinite recursion bug when parsing dependencies (#16342)
This commit is contained in:
parent
ca484430e0
commit
e3fed4c3eb
@ -46,6 +46,7 @@ pub mut:
|
|||||||
requires []string
|
requires []string
|
||||||
requires_private []string
|
requires_private []string
|
||||||
conflicts []string
|
conflicts []string
|
||||||
|
loaded []string
|
||||||
}
|
}
|
||||||
|
|
||||||
fn (mut pc PkgConfig) parse_list_no_comma(s string) []string {
|
fn (mut pc PkgConfig) parse_list_no_comma(s string) []string {
|
||||||
@ -199,8 +200,13 @@ fn (mut pc PkgConfig) load_requires() ? {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn (mut pc PkgConfig) load_require(dep string) ? {
|
fn (mut pc PkgConfig) load_require(dep string) ? {
|
||||||
|
if dep in pc.loaded {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
pc.loaded << dep
|
||||||
mut pcdep := PkgConfig{
|
mut pcdep := PkgConfig{
|
||||||
paths: pc.paths
|
paths: pc.paths
|
||||||
|
loaded: pc.loaded
|
||||||
}
|
}
|
||||||
depfile := pcdep.resolve(dep) or {
|
depfile := pcdep.resolve(dep) or {
|
||||||
if pc.options.debug {
|
if pc.options.debug {
|
||||||
@ -211,7 +217,9 @@ fn (mut pc PkgConfig) load_require(dep string) ? {
|
|||||||
if !pcdep.parse(depfile) {
|
if !pcdep.parse(depfile) {
|
||||||
return error('required file "$depfile" could not be parsed')
|
return error('required file "$depfile" could not be parsed')
|
||||||
}
|
}
|
||||||
|
if !pc.options.norecurse {
|
||||||
pcdep.load_requires()?
|
pcdep.load_requires()?
|
||||||
|
}
|
||||||
pc.extend(pcdep)?
|
pc.extend(pcdep)?
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user