summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorVinson Lee <[email protected]>2011-01-14 16:18:52 -0800
committerVinson Lee <[email protected]>2011-01-14 16:18:52 -0800
commit7772a34f3aedfa8ef58ad5f912f56bd5adf27057 (patch)
treeec9d95fded3e5b21a44e2f48b5440eecb405d00f /src/mesa
parent7b987578a94008e28daa5cacf68ee37566a27be8 (diff)
mesa: Dynamically allocate acp array in ir_to_mesa_visitor::copy_propagate.
Fixes these MSVC errors. ir_to_mesa.cpp(2644) : error C2057: expected constant expression ir_to_mesa.cpp(2644) : error C2466: cannot allocate an array of constant size 0 ir_to_mesa.cpp(2644) : error C2133: 'acp' : unknown size ir_to_mesa.cpp(2646) : error C2070: 'ir_to_mesa_instruction *[]': illegal sizeof operand ir_to_mesa.cpp(2709) : error C2070: 'ir_to_mesa_instruction *[]': illegal sizeof operand ir_to_mesa.cpp(2718) : error C2070: 'ir_to_mesa_instruction *[]': illegal sizeof operand
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/program/ir_to_mesa.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp
index 0d40b093e4f..cb310231704 100644
--- a/src/mesa/program/ir_to_mesa.cpp
+++ b/src/mesa/program/ir_to_mesa.cpp
@@ -2641,9 +2641,9 @@ set_uniform_initializers(struct gl_context *ctx,
void
ir_to_mesa_visitor::copy_propagate(void)
{
- ir_to_mesa_instruction *acp[this->next_temp * 4];
+ ir_to_mesa_instruction **acp = new ir_to_mesa_instruction *[this->next_temp * 4];
- memset(&acp, 0, sizeof(acp));
+ memset(acp, 0, sizeof(acp) * this->next_temp * 4);
foreach_iter(exec_list_iterator, iter, this->instructions) {
ir_to_mesa_instruction *inst = (ir_to_mesa_instruction *)iter.get();
@@ -2741,6 +2741,8 @@ ir_to_mesa_visitor::copy_propagate(void)
}
}
}
+
+ delete [] acp;
}