mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 22:49:13 +02:00
Fix setting the maximum accessed array element
Array dereferences now point to variable dereferences instead of pointing directly to variables. This necessitated some changes to the way the variable is accessed when setting the maximum index array element.
This commit is contained in:
parent
fd55da2147
commit
a9159f9e87
1 changed files with 8 additions and 2 deletions
|
|
@ -1097,7 +1097,7 @@ ast_expression::hir(exec_list *instructions,
|
|||
|
||||
error_emitted = op[0]->type->is_error() || op[1]->type->is_error();
|
||||
|
||||
ir_instruction *const array = op[0];
|
||||
ir_rvalue *const array = op[0];
|
||||
|
||||
result = new ir_dereference_array(op[0], op[1]);
|
||||
|
||||
|
|
@ -1181,7 +1181,13 @@ ast_expression::hir(exec_list *instructions,
|
|||
}
|
||||
|
||||
if (array->type->is_array()) {
|
||||
ir_variable *const v = array->as_variable();
|
||||
/* If the array is a variable dereference, it dereferences the
|
||||
* whole array, by definition. Use this to get the variable.
|
||||
*
|
||||
* FINISHME: Should some methods for getting / setting / testing
|
||||
* FINISHME: array access limits be added to ir_dereference?
|
||||
*/
|
||||
ir_variable *const v = array->whole_variable_referenced();
|
||||
if ((v != NULL) && (unsigned(idx) > v->max_array_access))
|
||||
v->max_array_access = idx;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue