• Emmanuel T Odeke's avatar
    cmd/compile: fix label redefinition error column numbers · 0b63086f
    Emmanuel T Odeke authored
    Ensure that label redefinition error column numbers
    print the actual start of the label instead of the
    position of the label's delimiting token ":".
    
    For example, given this program:
    
    package main
    
    func main() {
    
                foo:
       foo:
    foo:
    foo            :
    }
    
    * Before:
    main.go:5:13: label foo defined and not used
    main.go:6:7: label foo already defined at main.go:5:13
    main.go:7:4: label foo already defined at main.go:5:13
    main.go:8:16: label foo already defined at main.go:5:13
    
    * After:
    main.go:5:13: label foo defined and not used
    main.go:6:4: label foo already defined at main.go:5:13
    main.go:7:1: label foo already defined at main.go:5:13
    main.go:8:1: label foo already defined at main.go:5:13
    
    Fixes #26411
    
    Change-Id: I8eb874b97fdc8862547176d57ac2fa0f075f2367
    Reviewed-on: https://go-review.googlesource.com/c/124595
    Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarRobert Griesemer <gri@golang.org>
    0b63086f
Name
Last commit
Last update
..
amd64 Loading commit data...
arm Loading commit data...
arm64 Loading commit data...
gc Loading commit data...
mips Loading commit data...
mips64 Loading commit data...
ppc64 Loading commit data...
s390x Loading commit data...
ssa Loading commit data...
syntax Loading commit data...
test Loading commit data...
types Loading commit data...
wasm Loading commit data...
x86 Loading commit data...