From: Vinson Lee Date: Sat, 15 Jan 2011 00:18:52 +0000 (-0800) Subject: mesa: Dynamically allocate acp array in ir_to_mesa_visitor::copy_propagate. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7772a34f3aedfa8ef58ad5f912f56bd5adf27057;p=mesa.git 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 --- 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; }