[Mesa-dev] [PATCH] mesa/st: fix infinite loops
Timothy Arceri
tarceri at itsqueeze.com
Thu Sep 21 02:13:29 UTC 2017
Fixes: 9ac8fece63a9 (glsl: Unify ir_constant::const_elements and ::components)
---
src/mesa/program/ir_to_mesa.cpp | 2 +-
src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp
index 03d615ffe4..e4803aa490 100644
--- a/src/mesa/program/ir_to_mesa.cpp
+++ b/src/mesa/program/ir_to_mesa.cpp
@@ -1915,21 +1915,21 @@ ir_to_mesa_visitor::visit(ir_constant *ir)
for (i = 0; i < ir->type->length; i++) {
ir_constant *const field_value = ir->get_record_field(i);
int size = type_size(field_value->type);
assert(size > 0);
field_value->accept(this);
src = this->result;
- for (i = 0; i < (unsigned int)size; i++) {
+ for (unsigned j = 0; j < (unsigned int)size; j++) {
emit(ir, OPCODE_MOV, temp, src);
src.index++;
temp.index++;
}
}
this->result = temp_base;
return;
}
diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index b49590bd6b..609920a7a8 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -3047,21 +3047,21 @@ glsl_to_tgsi_visitor::visit(ir_constant *ir)
for (i = 0; i < ir->type->length; i++) {
ir_constant *const field_value = ir->get_record_field(i);
int size = type_size(field_value->type);
assert(size > 0);
field_value->accept(this);
src = this->result;
- for (i = 0; i < (unsigned int)size; i++) {
+ for (unsigned j = 0; j < (unsigned int)size; j++) {
emit_asm(ir, TGSI_OPCODE_MOV, temp, src);
src.index++;
temp.index++;
}
}
this->result = temp_base;
return;
}
--
2.13.5
More information about the mesa-dev
mailing list