1 /* go-defer.h -- the defer stack.
3 Copyright 2010 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 struct __go_panic_stack
;
9 /* The defer stack is a list of these structures. */
11 struct __go_defer_stack
13 /* The next entry in the stack. */
14 struct __go_defer_stack
*__next
;
16 /* The stack variable for the function which called this defer
17 statement. This is set to 1 if we are returning from that
18 function, 0 if we are panicing through it. */
21 /* The value of the panic stack when this function is deferred.
22 This function can not recover this value from the panic stack.
23 This can happen if a deferred function has a defer statement
25 struct __go_panic_stack
*__panic
;
27 /* The function to call. */
28 void (*__pfn
) (void *);
30 /* The argument to pass to the function. */
33 /* The return address that a recover thunk matches against. This is
34 set by __go_set_defer_retaddr which is called by the thunks
35 created by defer statements. */
36 const void *__retaddr
;
38 /* Set to true if a function created by reflect.MakeFunc is
39 permitted to recover. The return address of such a function
40 function will be somewhere in libffi, so __retaddr is not
42 _Bool __makefunc_can_recover
;
44 /* Set to true if this defer stack entry is not part of the defer