Ensure panic functions are never stripped.

This commit is contained in:
Christoffer Lerno
2023-06-02 23:06:59 +02:00
committed by Christoffer Lerno
parent cfd21f8ca2
commit 0de47d7c83

View File

@@ -261,6 +261,8 @@ static void assign_panicfn(void)
error_exit("Expected panic function to have the signature fn void(String, String, String, uint).");
}
global_context.panic_var = decl;
decl->no_strip = true;
if (active_target.no_stdlib) return;
const char *panicf = "std::core::builtin::panicf";
@@ -275,6 +277,8 @@ static void assign_panicfn(void)
return;
}
panicf_decl->no_strip = true;
Type *panicf_fn_type = panicf_decl->type->canonical;
if (panicf_decl->decl_kind != DECL_FUNC)
{