# HG changeset patch # User laurent # Date 1318184335 -7200 # Node ID 2fd934b91ffd0968f04a4529db602319b0cc70d0 # Parent b78e59ed426982c95e319167642f55611ea2337e Fix bug in code generation of directly declared array variables that generate wrong code when using located variables in a program POU diff -r b78e59ed4269 -r 2fd934b91ffd stage4/generate_c/generate_c.cc --- a/stage4/generate_c/generate_c.cc Sun Oct 09 20:16:41 2011 +0200 +++ b/stage4/generate_c/generate_c.cc Sun Oct 09 20:18:55 2011 +0200 @@ -868,7 +868,12 @@ /* variable_name -> may be NULL ! */ //SYM_REF4(located_var_decl_c, variable_name, location, located_var_spec_init, unused) void *visit(located_var_decl_c *symbol) { - symbol->located_var_spec_init->accept(*this); + array_spec_init_c* array_spec_init = dynamic_cast(symbol->located_var_spec_init); + if (array_spec_init != NULL) { + current_mode = arrayname_im; + symbol->located_var_spec_init->accept(*this); + current_mode = none_im; + } return NULL; }