1 /* go-defer.h -- the defer stack. 2 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. */ 6 7 struct __go_panic_stack; 8 9 /* The defer stack is a list of these structures. */ 10 11 struct __go_defer_stack 12 { 13 /* The next entry in the stack. */ 14 struct __go_defer_stack *__next; 15 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. */ 19 _Bool *__frame; 20 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 24 itself. */ 25 struct __go_panic_stack *__panic; 26 27 /* The function to call. */ 28 void (*__pfn) (void *); 29 30 /* The argument to pass to the function. */ 31 void *__arg; 32 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; 37 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 41 useful. */ 42 _Bool __makefunc_can_recover; 43 44 /* Set to true if this defer stack entry is not part of the defer 45 pool. */ 46 _Bool __special; 47 }; 48