mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-02-25 13:11:00 +00:00
[qfcc] Fix some crashes when parsing bsp_turb.frag
Incorrect type accesses and unnamed interfaces.
This commit is contained in:
parent
34b94aec96
commit
28a85b1624
3 changed files with 4 additions and 3 deletions
|
@ -1674,6 +1674,7 @@ get_name (const expr_t *e)
|
||||||
symbol_t *
|
symbol_t *
|
||||||
get_struct_field (const type_t *t1, const expr_t *e1, const expr_t *e2)
|
get_struct_field (const type_t *t1, const expr_t *e1, const expr_t *e2)
|
||||||
{
|
{
|
||||||
|
t1 = unalias_type (t1);
|
||||||
symtab_t *strct = t1->symtab;
|
symtab_t *strct = t1->symtab;
|
||||||
symbol_t *sym = get_name (e2);
|
symbol_t *sym = get_name (e2);
|
||||||
symbol_t *field;
|
symbol_t *field;
|
||||||
|
|
|
@ -1394,11 +1394,11 @@ binary_expr (int op, const expr_t *e1, const expr_t *e2)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_constant (e1) && is_double (t1) && e1->implicit && is_float (t2)) {
|
if (is_constant (e1) && is_double (t1) && e1->implicit && is_float (t2)) {
|
||||||
t1 = float_type (t2);
|
t1 = float_type (base_type (t2));
|
||||||
e1 = cast_expr (t1, e1);
|
e1 = cast_expr (t1, e1);
|
||||||
}
|
}
|
||||||
if (is_constant (e2) && is_double (t2) && e2->implicit && is_float (t1)) {
|
if (is_constant (e2) && is_double (t2) && e2->implicit && is_float (t1)) {
|
||||||
t2 = float_type (t1);
|
t2 = float_type (base_type (t1));
|
||||||
e2 = cast_expr (t2, e2);
|
e2 = cast_expr (t2, e2);
|
||||||
}
|
}
|
||||||
if (is_array (t1) && (is_pointer (t2) || is_integral (t2))) {
|
if (is_array (t1) && (is_pointer (t2) || is_integral (t2))) {
|
||||||
|
|
|
@ -45,7 +45,7 @@ void
|
||||||
glsl_parse_declaration (specifier_t spec, symbol_t *sym, const expr_t *init,
|
glsl_parse_declaration (specifier_t spec, symbol_t *sym, const expr_t *init,
|
||||||
symtab_t *symtab, expr_t *block)
|
symtab_t *symtab, expr_t *block)
|
||||||
{
|
{
|
||||||
if (sym->type) {
|
if (sym && sym->type) {
|
||||||
internal_error (0, "unexected typed symbol");
|
internal_error (0, "unexected typed symbol");
|
||||||
}
|
}
|
||||||
auto attributes = glsl_optimize_attributes (spec.attributes);
|
auto attributes = glsl_optimize_attributes (spec.attributes);
|
||||||
|
|
Loading…
Reference in a new issue