This is the mail archive of the
gcc-cvs@gcc.gnu.org
mailing list for the GCC project.
r268358 - in /trunk: gcc/go/gofrontend/MERGE li...
- From: ian at gcc dot gnu dot org
- To: gcc-cvs at gcc dot gnu dot org
- Date: Tue, 29 Jan 2019 00:49:24 -0000
- Subject: r268358 - in /trunk: gcc/go/gofrontend/MERGE li...
Author: ian
Date: Tue Jan 29 00:49:23 2019
New Revision: 268358
URL: https://gcc.gnu.org/viewcvs?rev=268358&root=gcc&view=rev
Log:
runtime: use the call instruction's PC for panic-in-runtime detection
If a panic happens in the runtime we turn that into a fatal error.
We use the caller's PC to determine if the panic call is inside
the runtime. getcallerpc returns the PC immediately after the
call instruction. If the call is the very last instruction of a
function, it may not find this PC belong to a runtime function,
giving false result. We need to back off the PC by 1 to the call
instruction.
The gc runtime doesn't do this because the gc compiler always
emit an instruction following a panic call, presumably an UNDEF
instruction which turns into an architecture-specific illegal
instruction. Our compiler doesn't do this.
Reviewed-on: https://go-review.googlesource.com/c/159437
Modified:
trunk/gcc/go/gofrontend/MERGE
trunk/libgo/go/runtime/panic.go
trunk/libgo/runtime/go-runtime-error.c