3 // Copyright 2014 The Go Authors. All rights reserved.
4 // Use of this source code is governed by a BSD-style
5 // license that can be found in the LICENSE file.
7 // Issue 8048. Incorrect handling of liveness when walking stack
8 // containing faulting frame.
21 // test1f will panic without its own defer.
22 // The runtime.GC checks that we can walk the stack
23 // at that point and not get confused.
24 // The recover lets test1 exit normally.
33 // Because b == false, the if does not execute,
34 // so x == nil, so the println(*x) faults reading
35 // from nil. The compiler will lay out the code
36 // so that the if body occurs above the *x,
37 // so if the liveness info at the *x is used, it will
38 // find the liveness at the call to runtime.GC.
39 // It will think y is live, but y is uninitialized,
40 // and the runtime will crash detecting a bad slice.
41 // The runtime should see that there are no defers
42 // corresponding to this panicked frame and ignore
43 // the frame entirely.
55 // Same as test1, but the fault happens in the function with the defer.
56 // The runtime should see the defer and garbage collect the frame
57 // as if the PC were immediately after the defer statement.
73 // Like test1 but avoid array index, which does not
74 // move to end of function on ARM.