mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 15:22:04 +00:00
Fix a segfault when the switch expression errors.
This commit is contained in:
parent
5df25133b3
commit
e8c17c68e6
1 changed files with 2 additions and 0 deletions
|
@ -127,6 +127,8 @@ case_label_expr (switch_block_t *switch_block, expr_t *value)
|
|||
if (value) {
|
||||
type_t *type = get_type (switch_block->test);
|
||||
type_t *val_type = get_type (value);
|
||||
if (!type)
|
||||
return 0;
|
||||
if (!type_assignable (type, get_type (value)))
|
||||
return error (value, "type mismatch in case label");
|
||||
if (is_integral (type) && is_integral (val_type)) {
|
||||
|
|
Loading…
Reference in a new issue