Fix null pointer exception on error

Bug: 172923994
Test: internal
Change-Id: I21f60e5f386214216e10a51c22247814ca2f2347
This commit is contained in:
Sasha Smundak
2021-07-27 10:44:48 -07:00
parent 7ae80a7044
commit f2c9f8bc14

View File

@@ -1079,7 +1079,7 @@ func (ctx *parseContext) parseReference(node mkparser.Node, ref *mkparser.MakeSt
if expr.name == "call" {
words = args.SplitN(",", 2)
if words[0].Empty() || !words[0].Const() {
return ctx.newBadExpr(nil, "cannot handle %s", refDump)
return ctx.newBadExpr(node, "cannot handle %s", refDump)
}
expr.name = words[0].Dump()
if len(words) < 2 {