void __rethrow(void *index) { struct eh_context *eh = (*get_eh_context) (); void *pc, *handler; long offset; frame_state my_ustruct, *my_udata = &my_ustruct; if (! eh->info) { __terminate (); } eh->table_index = index; label: my_udata = __frame_state_for (&&label, my_udata); if (! my_udata) { __terminate (); } my_udata->cfa = __builtin_dwarf_cfa (); __builtin_unwind_init (); pc = __builtin_extract_return_addr (__builtin_return_address (0)) - 1; handler = throw_helper (eh, pc, my_udata, &offset); __builtin_eh_return ((void *)eh, offset, handler); }
void dummy1(void) { void* cfa = (void*) __builtin_dwarf_cfa(); printf("cfa: %p\n", cfa); ASSERT(dummy0_cfa == cfa, "ERROR: cfa mismatch"); next_step(3); __builtin_eh_return (STACK_REMAINDER, dummy2); }
void dummy0(void) { /* NOTE: __builtin_dwarf_cfa() return a pointer to the "current stack frame" * CFA="canonical frame address". * We pick STACK_REMAINDER so that stack is completely cleaned up and * it looks like the function was never called. * Hence all the CFA's should be the same. */ void* cfa = (void*) __builtin_dwarf_cfa(); printf("cfa: %p\n", cfa); dummy0_cfa = cfa; next_step(2); __builtin_eh_return (STACK_REMAINDER, dummy1); }
int test13() { __builtin_eh_return(0, 0); // no warning, eh_return never returns. }
NOCOMPRESSION void foo (int x) { __builtin_unwind_init (); __builtin_eh_return (x, bar); }
void foo(void) { __builtin_unwind_init (); setup_offset(); __builtin_eh_return (offset, handler); }