mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 09:08:10 +02:00
glsl2: Avoid null deref in scalar constant unop expressions.
This commit is contained in:
parent
d4d630b72c
commit
570dc0d400
1 changed files with 6 additions and 1 deletions
|
|
@ -151,7 +151,12 @@ ir_constant_visitor::visit(ir_expression *ir)
|
|||
*/
|
||||
unsigned c0_inc = op0_scalar ? 1 : 0;
|
||||
unsigned c1_inc = op1_scalar ? 1 : 0;
|
||||
unsigned components = op[op1_scalar ? 0 : 1]->type->components();
|
||||
unsigned components;
|
||||
if (op1_scalar || !op[1]) {
|
||||
components = op[0]->type->components();
|
||||
} else {
|
||||
components = op[1]->type->components();
|
||||
}
|
||||
|
||||
switch (ir->operation) {
|
||||
case ir_unop_logic_not:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue