]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: hide init functions in tracebacks
authorKeith Randall <keithr@alum.mit.edu>
Fri, 25 Jan 2019 18:21:40 +0000 (10:21 -0800)
committerKeith Randall <khr@golang.org>
Sun, 27 Jan 2019 04:02:46 +0000 (04:02 +0000)
commiteafe9a186c84dcfb7db1038cc43d1f0dfd1ea781
tree0b5437cda2e07de7066adf8fe328722dccac3a86
parentd585f04fd39f86edaa2aafd776e9ad037d075396
cmd/compile: hide init functions in tracebacks

Treat compiler-generated init functions as wrappers, so they will not
be shown in tracebacks.

The exception to this rule is that we'd like to show the line number
of initializers for global variables in tracebacks. In order to
preserve line numbers for those cases, separate out the code for those
initializers into a separate function (which is not marked as
autogenerated).

This CL makes the go binary 0.2% bigger.

Fixes #29919

Change-Id: I0f1fbfc03d10d764ce3a8ddb48fb387ca8453386
Reviewed-on: https://go-review.googlesource.com/c/159717
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/cmd/compile/internal/gc/init.go
src/cmd/internal/objabi/funcid.go
test/fixedbugs/issue29919.dir/a.go [new file with mode: 0644]
test/fixedbugs/issue29919.dir/main.go [new file with mode: 0644]
test/fixedbugs/issue29919.go [new file with mode: 0644]