mirror of
https://github.com/odin-lang/Odin.git
synced 2026-06-08 03:24:19 +00:00
Fix compiler crash when switching on no value
This commit is contained in:
@@ -1060,6 +1060,9 @@ gb_internal void check_switch_stmt(CheckerContext *ctx, Ast *node, u32 mod_flags
|
||||
if (ss->tag != nullptr) {
|
||||
check_expr(ctx, &x, ss->tag);
|
||||
check_assignment(ctx, &x, nullptr, str_lit("switch expression"));
|
||||
if (x.type == nullptr) {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
x.mode = Addressing_Constant;
|
||||
x.type = t_bool;
|
||||
|
||||
Reference in New Issue
Block a user