mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-03 22:20:09 +01:00
glsl: fix potential crash in expression flattening
The base_ir variable used by this pass is set via visit_list_elements() however this pass was skipping visit_list_elements() for the initial list of instructions i.e. it was skipping it for globals so if we ended up trying to flatten an expression on a global we would segfault. To quote the code comment on the base_ir variable: "This is implemented by visit_list_elements -- if the visitor is not called by it, nothing good will happen" Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27743>
This commit is contained in:
parent
ac45d893d6
commit
82d617e8b1
1 changed files with 1 additions and 4 deletions
|
|
@ -56,10 +56,7 @@ do_expression_flattening(exec_list *instructions,
|
|||
bool (*predicate)(ir_instruction *ir))
|
||||
{
|
||||
ir_expression_flattening_visitor v(predicate);
|
||||
|
||||
foreach_in_list(ir_instruction, ir, instructions) {
|
||||
ir->accept(&v);
|
||||
}
|
||||
visit_list_elements(&v, instructions);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue