Odin icon indicating copy to clipboard operation
Odin copied to clipboard

Do not generate structured exception handling when not used.

Open JesseRMeyer opened this issue 3 years ago • 2 comments
trafficstars

Odin currently produces structured exception handling code even though it is never used.

https://github.com/compiler-explorer/compiler-explorer/issues/4028

Allow users to opt-in with their own handlers.

JesseRMeyer avatar Sep 05 '22 21:09 JesseRMeyer

This just requires adding the following to lb_create_procedure near the other attribute stuff:

if (!ignore_body || is_calling_convention_odin(pt->Proc.calling_convention)) {
	lb_add_attribute_to_proc(m, p->value, "nounwind");
}

Only issue is that I'm not if this is a good idea or not yet just because of foreign code.

gingerBill avatar Sep 07 '22 10:09 gingerBill

It appears that SEH is required for seeing the stack trace in debug builds. Without it, no stack trace.

gingerBill avatar Sep 07 '22 11:09 gingerBill