runtime: improve handling of panic during deferred function
commite0fc4b99255ee5cafa023dc029c239c832e11cf5
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 23 Jun 2017 13:45:36 +0000 (23 13:45 +0000)
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 23 Jun 2017 13:45:36 +0000 (23 13:45 +0000)
treeeea40c0f194dee2f158ed71d9fca0420fd4b4204
parentaa6cb10551b9e1a5f7638ff6dcb5f89f95c6bdb6
runtime: improve handling of panic during deferred function

    When a panic occurs while processing a deferred function that
    recovered an earlier panic, we shouldn't report the recovered panic
    in the panic stack trace. Stop doing so by keeping track of the panic
    that triggered a defer, marking it as aborted if we see the defer again,
    and discarding aborted panics when a panic is recovered. This is what
    the gc runtime does.

    The test for this is TestRecursivePanic in runtime/crash_test.go.
    We don't run that test yet, but we will soon.

    Reviewed-on: https://go-review.googlesource.com/46461

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@249590 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/go/gofrontend/MERGE
libgo/go/runtime/panic.go
libgo/go/runtime/runtime2.go