Skip to content

Commit

Permalink
Ensure panic functions are never stripped.
Browse files Browse the repository at this point in the history
  • Loading branch information
lerno committed Jun 2, 2023
1 parent cfd21f8 commit 0de47d7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/compiler/semantic_analyser.c
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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)
{
Expand Down

0 comments on commit 0de47d7

Please sign in to comment.