projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d4d630b
)
glsl2: Avoid null deref in scalar constant unop expressions.
author
Eric Anholt
<eric@anholt.net>
Wed, 7 Jul 2010 16:07:09 +0000
(09:07 -0700)
committer
Eric Anholt
<eric@anholt.net>
Wed, 7 Jul 2010 16:07:52 +0000
(09:07 -0700)
src/glsl/ir_constant_expression.cpp
patch
|
blob
|
history
diff --git
a/src/glsl/ir_constant_expression.cpp
b/src/glsl/ir_constant_expression.cpp
index 541398a91c7afd346c69700e1d60d365836a59e6..98cbb6cec6cd75f570c16334769ddeba264703ea 100644
(file)
--- a/
src/glsl/ir_constant_expression.cpp
+++ b/
src/glsl/ir_constant_expression.cpp
@@
-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: