mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-09 23:29:03 +00:00
switch trap in debug mode when no prong found
This commit is contained in:
parent
093e0d1bb0
commit
663a1d0cd5
1 changed files with 3 additions and 0 deletions
|
|
@ -2412,6 +2412,9 @@ static LLVMValueRef gen_switch_expr(CodeGen *g, AstNode *node) {
|
||||||
if (!else_prong) {
|
if (!else_prong) {
|
||||||
LLVMPositionBuilderAtEnd(g->builder, else_block);
|
LLVMPositionBuilderAtEnd(g->builder, else_block);
|
||||||
add_debug_source_node(g, node);
|
add_debug_source_node(g, node);
|
||||||
|
if (!g->is_release_build) {
|
||||||
|
LLVMBuildCall(g->builder, g->trap_fn_val, nullptr, 0, "");
|
||||||
|
}
|
||||||
LLVMBuildUnreachable(g->builder);
|
LLVMBuildUnreachable(g->builder);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue