mirror of
https://github.com/ziglang/zig.git
synced 2024-11-27 07:32:44 +00:00
switch trap in debug mode when no prong found
This commit is contained in:
parent
093e0d1bb0
commit
663a1d0cd5
@ -2412,6 +2412,9 @@ static LLVMValueRef gen_switch_expr(CodeGen *g, AstNode *node) {
|
||||
if (!else_prong) {
|
||||
LLVMPositionBuilderAtEnd(g->builder, else_block);
|
||||
add_debug_source_node(g, node);
|
||||
if (!g->is_release_build) {
|
||||
LLVMBuildCall(g->builder, g->trap_fn_val, nullptr, 0, "");
|
||||
}
|
||||
LLVMBuildUnreachable(g->builder);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user