Allow array_dimension_iterator to accept an array_spec_init_c.
authormjsousa
Wed, 21 Aug 2013 21:56:41 +0100
changeset 840 60cea9fea6e6
parent 839 99d9ef4d210b
child 841 aed36f08545d
Allow array_dimension_iterator to accept an array_spec_init_c.
Fixes bug activated by generating C code from IL code containing array variables.
absyntax_utils/array_dimension_iterator.cc
--- a/absyntax_utils/array_dimension_iterator.cc	Wed Aug 21 21:34:43 2013 +0100
+++ b/absyntax_utils/array_dimension_iterator.cc	Wed Aug 21 21:56:41 2013 +0100
@@ -88,7 +88,9 @@
    *               v1 := v2[33, 45];
    *       The above error will be caught by the datatype checking algorithms!
    */
-  array_specification_c* array_spec = dynamic_cast<array_specification_c*>(symbol);
+  array_spec_init_c    * array_spec_init = dynamic_cast<array_spec_init_c    *>(symbol); 
+  if (NULL != array_spec_init)    symbol = array_spec_init->array_specification;
+  array_specification_c* array_spec      = dynamic_cast<array_specification_c*>(symbol);
   // if (NULL == array_spec) ERROR;
 
   /* OK. Now initialize this object... */