From: Mark Pulford Date: Sun, 3 Sep 2017 13:53:38 +0000 (+1000) Subject: cmd/compile: ignore non-code nodes when inlining X-Git-Tag: go1.10beta1~1224 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=812b34efaed87584977dd56fbd3b366e13b314f5;p=gostls13.git cmd/compile: ignore non-code nodes when inlining Avoid counting nodes that don't generate code (eg, constants) against the inlining budget. Fixes #21749 Change-Id: I10fca073e64be7d304709ef33e125eb8c78d5e4d Reviewed-on: https://go-review.googlesource.com/61250 Reviewed-by: Matthew Dempsky Run-TryBot: Matthew Dempsky TryBot-Result: Gobot Gobot --- diff --git a/src/cmd/compile/internal/gc/inl.go b/src/cmd/compile/internal/gc/inl.go index dfa13e3c3b..f9f273f5a8 100644 --- a/src/cmd/compile/internal/gc/inl.go +++ b/src/cmd/compile/internal/gc/inl.go @@ -279,6 +279,10 @@ func (v *hairyVisitor) visit(n *Node) bool { ORETJMP: v.reason = "unhandled op " + n.Op.String() return true + + case ODCLCONST, OEMPTY, OFALL, OLABEL: + // These nodes don't produce code; omit from inlining budget. + return false } v.budget--