The problem is that parse_expression() can generate an error, but the caller (the array statement) can't detect that fact to exit its loop.
Now parse_expression() returns a zero value with ERROR_MV set to indicate a blatant error. (Not every single error, but the ones which can lead to an infinite loop of errors. "Expected expression but found EOF" is the big offender here.)
ERROR_MV is ignored in most situations; the error has been reported, so we can just treat it as a regular zero and move on. But in two places in arrays.c, we check for it and break out of a loop. I may find other good places for this check in the future.
Fixes https://github.com/DavidKinder/Inform6/issues/246 .
The problem is that parse_expression() can generate an error, but the caller (the array statement) can't detect that fact to exit its loop.
Now parse_expression() returns a zero value with ERROR_MV set to indicate a blatant error. (Not every single error, but the ones which can lead to an infinite loop of errors. "Expected expression but found EOF" is the big offender here.)
ERROR_MV is ignored in most situations; the error has been reported, so we can just treat it as a regular zero and move on. But in two places in arrays.c, we check for it and break out of a loop. I may find other good places for this check in the future.