Commit 812b34ef authored by Mark Pulford's avatar Mark Pulford Committed by Matthew Dempsky

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/61250Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent b2e8630f
......@@ -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--
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment