mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-29 23:52:22 +00:00
[qfcc] Fix segfault when assigning {}
I had intended to check, but forgot.
This commit is contained in:
parent
b6439e8dc1
commit
48a256efaa
1 changed files with 17 additions and 13 deletions
|
@ -293,11 +293,19 @@ assign_expr (expr_t *dst, expr_t *src)
|
|||
type_t *dst_type, *src_type;
|
||||
|
||||
convert_name (dst);
|
||||
convert_name (src);
|
||||
|
||||
if (dst->type == ex_error) {
|
||||
return dst;
|
||||
}
|
||||
if ((expr = check_valid_lvalue (dst))) {
|
||||
return expr;
|
||||
}
|
||||
dst_type = get_type (dst);
|
||||
if (!dst_type) {
|
||||
internal_error (dst, "dst_type broke in assign_expr");
|
||||
}
|
||||
|
||||
if (src) {
|
||||
convert_name (src);
|
||||
if (src->type == ex_error) {
|
||||
return src;
|
||||
}
|
||||
|
@ -306,15 +314,11 @@ assign_expr (expr_t *dst, expr_t *src)
|
|||
&& (expr = check_assign_logic_precedence (dst, src))) {
|
||||
return expr;
|
||||
}
|
||||
|
||||
|
||||
if ((expr = check_valid_lvalue (dst))) {
|
||||
return expr;
|
||||
} else {
|
||||
if (is_scalar (dst_type)) {
|
||||
return error (dst, "empty scalar initializer");
|
||||
}
|
||||
|
||||
dst_type = get_type (dst);
|
||||
if (!dst_type) {
|
||||
internal_error (dst, "dst_type broke in assign_expr");
|
||||
src = new_nil_expr ();
|
||||
}
|
||||
if (src->type == ex_compound) {
|
||||
src = initialized_temp_expr (dst_type, src);
|
||||
|
|
Loading…
Reference in a new issue