aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/syntax/parser.go
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2018-02-14 16:57:28 -0800
committerRobert Griesemer <gri@golang.org>2018-02-15 01:48:16 +0000
commit1a2273874953517cc38f7005e985c91d16ebf33c (patch)
tree69a89b29321182d254e18e4082f9dd553ff0df61 /src/cmd/compile/internal/syntax/parser.go
parentd3f6d11d845fafe849d33505194b3ea1787e73a8 (diff)
downloadgo-1a2273874953517cc38f7005e985c91d16ebf33c.tar.xz
cmd/compile/internal/syntax: more tolerant handling of missing function invocation in go/defer
Assume that an expression that is not a function call in a defer/go statement is indeed a function that is just missing its invocation. Report the error but continue with a sane syntax tree. Fixes #23586. Change-Id: Ib45ebac57c83b3e39ae4a1b137ffa291dec5b50d Reviewed-on: https://go-review.googlesource.com/94156 Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Diffstat (limited to 'src/cmd/compile/internal/syntax/parser.go')
-rw-r--r--src/cmd/compile/internal/syntax/parser.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/compile/internal/syntax/parser.go b/src/cmd/compile/internal/syntax/parser.go
index 832f991a6d..5b7ac6cc40 100644
--- a/src/cmd/compile/internal/syntax/parser.go
+++ b/src/cmd/compile/internal/syntax/parser.go
@@ -758,7 +758,7 @@ func (p *parser) callStmt() *CallStmt {
// already progressed, no need to advance
cx = new(CallExpr)
cx.pos = x.Pos()
- cx.Fun = p.bad()
+ cx.Fun = x // assume common error of missing parentheses (function invocation)
}
s.Call = cx