Skip to content

Commit

Permalink
Work around panic when parsing '.ifndef VARNAME'
Browse files Browse the repository at this point in the history
  • Loading branch information
rillig committed Mar 18, 2024
1 parent bce3225 commit 688374d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions v23/mkcondchecker.go
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,12 @@ func (ck *MkCondChecker) collectFacts(mkline *MkLine) []VarFact {

var collectCond func(cond *MkCond)
collectCond = func(cond *MkCond) {
if cond == nil {
// TODO: This is a workaround for a panic in '.ifndef VARNAME'.
// Seen in net/wget/hacks.mk 1.1.
// The parser for conditions needs to accept bare words.
return
}
if cond.Term != nil {
collectExpr(cond.Term.Expr)
}
Expand Down

0 comments on commit 688374d

Please sign in to comment.