• Josh Bleecher Snyder's avatar
    cmd/compile: avoid panic when printing *<N> · e41fb559
    Josh Bleecher Snyder authored
    When compiling the program:
    
    package p
    
    func _(){
    	*;:=
    }
    
    Before:
    
    x.go:4:3: syntax error: unexpected semicolon, expecting expression
    x.go:4:4: non-name *%!v(PANIC=runtime error: invalid memory address or nil pointer dereference) on left side of :=
    x.go:5:1: syntax error: unexpected }, expecting expression
    
    After:
    
    x.go:4:3: syntax error: unexpected semicolon, expecting expression
    x.go:4:4: non-name *<N> on left side of :=
    x.go:5:1: syntax error: unexpected }, expecting expression
    
    No test because:
    
    (1) we don't have a good mechanism to check for the
        absence of the string "PANIC" in an error message
    (2) the string "*<N>", while better, is itself ugly enough
        that I don't want to actively check for it
    (3) the bug isn't very important, the kind of thing only fuzzers encounter
    (4) the fix is obvious and trivial
    
    Fixes #20220
    
    Change-Id: I35faa986b60b671414ee999d6264b06937f250e3
    Reviewed-on: https://go-review.googlesource.com/42498
    Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
    Reviewed-by: 's avatarRobert Griesemer <gri@golang.org>
    Reviewed-by: 's avatarDavid Crawshaw <crawshaw@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    e41fb559
Name
Last commit
Last update
..
addr2line Loading commit data...
api Loading commit data...
asm 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...
trace Loading commit data...
vendor Loading commit data...
vet Loading commit data...