• David Chase's avatar
    cmd/compile: prevent double-walk of switch for OPRINT/OPRINTN · d924c333
    David Chase authored
    When a println arg contains a call to an inlineable function
    that itself contains a switch, that switch statement will be
    walked twice, once by the walkexprlist formerly in the
    OPRINT/OPRINTN case, then by walkexprlistcheap in walkprint.
    
    Remove the first walkexprlist, it is not necessary.
    walkexprlist =
    		s[i] = walkexpr(s[i], init)
    walkexprlistcheap = {
    		s[i] = cheapexpr(n, init)
    		s[i] = walkexpr(s[i], init)
    }
    
    Seems like this might be possible in other places, i.e.,
    calls to inlineable switch-containing functions.
    
    See also #25776.
    Fixes #29220.
    
    Change-Id: I3781e86aad6688711597b8bee9bc7ebd3af93601
    Reviewed-on: https://go-review.googlesource.com/c/154497
    Run-TryBot: David Chase <drchase@google.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarKeith Randall <khr@golang.org>
    d924c333
Name
Last commit
Last update
..
addr2line Loading commit data...
api Loading commit data...
asm Loading commit data...
buildid Loading commit data...
cgo Loading commit data...
compile Loading commit data...
cover Loading commit data...
dist Loading commit data...
doc Loading commit data...
fix Loading commit data...
go Loading commit data...
gofmt Loading commit data...
internal Loading commit data...
link Loading commit data...
nm Loading commit data...
objdump Loading commit data...
pack Loading commit data...
pprof Loading commit data...
test2json Loading commit data...
trace Loading commit data...
vendor Loading commit data...
vet Loading commit data...