mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-23 02:30:12 +01:00
glsl2: Don't dereference a NULL var in CE handling during a compile error.
If an undeclared variable was dereferenced in an expression that needed constant expression handling, we would walk off a null ir->var pointer. Fixes: glsl1-TIntermediate::addUnaryMath
This commit is contained in:
parent
20c074ae28
commit
54f583a206
1 changed files with 4 additions and 0 deletions
|
|
@ -676,6 +676,10 @@ ir_swizzle::constant_expression_value()
|
||||||
ir_constant *
|
ir_constant *
|
||||||
ir_dereference_variable::constant_expression_value()
|
ir_dereference_variable::constant_expression_value()
|
||||||
{
|
{
|
||||||
|
/* This may occur during compile and var->type is glsl_type::error_type */
|
||||||
|
if (!var)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
return var->constant_value ? var->constant_value->clone(NULL) : NULL;
|
return var->constant_value ? var->constant_value->clone(NULL) : NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue