mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile/internal/parser: don't crash after unexpected token
Added missing nil-check. We will get rid of the gcCompat corrections shortly but it's still worthwhile having the new test case added. Fixes #19056. Change-Id: I35bd938a4d789058da15724e34c05e5e631ecad0 Reviewed-on: https://go-review.googlesource.com/36908 Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
This commit is contained in:
parent
8da91a6297
commit
ee2f5fafd8
2 changed files with 10 additions and 1 deletions
|
|
@ -799,7 +799,7 @@ loop:
|
|||
p.syntax_error("expecting name or (")
|
||||
p.advance(_Semi, _Rparen)
|
||||
}
|
||||
if gcCompat {
|
||||
if gcCompat && x != nil {
|
||||
x.init(p)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue