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,29 +293,33 @@ assign_expr (expr_t *dst, expr_t *src)
|
||||||
type_t *dst_type, *src_type;
|
type_t *dst_type, *src_type;
|
||||||
|
|
||||||
convert_name (dst);
|
convert_name (dst);
|
||||||
convert_name (src);
|
|
||||||
|
|
||||||
if (dst->type == ex_error) {
|
if (dst->type == ex_error) {
|
||||||
return dst;
|
return dst;
|
||||||
}
|
}
|
||||||
if (src->type == ex_error) {
|
|
||||||
return src;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (options.traditional
|
|
||||||
&& (expr = check_assign_logic_precedence (dst, src))) {
|
|
||||||
return expr;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if ((expr = check_valid_lvalue (dst))) {
|
if ((expr = check_valid_lvalue (dst))) {
|
||||||
return expr;
|
return expr;
|
||||||
}
|
}
|
||||||
|
|
||||||
dst_type = get_type (dst);
|
dst_type = get_type (dst);
|
||||||
if (!dst_type) {
|
if (!dst_type) {
|
||||||
internal_error (dst, "dst_type broke in assign_expr");
|
internal_error (dst, "dst_type broke in assign_expr");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (src) {
|
||||||
|
convert_name (src);
|
||||||
|
if (src->type == ex_error) {
|
||||||
|
return src;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (options.traditional
|
||||||
|
&& (expr = check_assign_logic_precedence (dst, src))) {
|
||||||
|
return expr;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (is_scalar (dst_type)) {
|
||||||
|
return error (dst, "empty scalar initializer");
|
||||||
|
}
|
||||||
|
src = new_nil_expr ();
|
||||||
|
}
|
||||||
if (src->type == ex_compound) {
|
if (src->type == ex_compound) {
|
||||||
src = initialized_temp_expr (dst_type, src);
|
src = initialized_temp_expr (dst_type, src);
|
||||||
if (src->type == ex_error) {
|
if (src->type == ex_error) {
|
||||||
|
|
Loading…
Reference in a new issue