# HG changeset patch # User mjsousa # Date 1336601584 -3600 # Node ID 322f063daa9f88c189f3ba96e34616d78f1f0eea # Parent af9517cad953b9de5af764d453d653b46c9265df Fix the previous commit: check for errors in expressions used as subscripts. diff -r af9517cad953 -r 322f063daa9f stage3/print_datatypes_error.cc --- a/stage3/print_datatypes_error.cc Wed May 09 20:05:57 2012 +0200 +++ b/stage3/print_datatypes_error.cc Wed May 09 23:13:04 2012 +0100 @@ -593,7 +593,10 @@ // SYM_LIST(subscript_list_c) void *print_datatypes_error_c::visit(subscript_list_c *symbol) { for (int i = 0; i < symbol->n; i++) { - if (NULL == symbol->elements[i]->datatype) + int start_error_count = error_count; + symbol->elements[i]->accept(*this); + /* I (mjs) do not believe that the following error message will ever get printed, but lets play it safe and leave it in... */ + if ((start_error_count == error_count) && (NULL == symbol->elements[i]->datatype)) STAGE3_ERROR(0, symbol, symbol, "Invalid data type for array subscript field."); } return NULL;