Opened 10 years ago
Last modified 7 years ago
#2931 assigned defect
Bootstrapped compiler should check undefined variables in if branches — at Initial Version
Reported by: | Adrian Pop | Owned by: | Martin Sjölund |
---|---|---|---|
Priority: | high | Milestone: | Future |
Component: | MetaModelica | Version: | trunk |
Keywords: | Cc: |
Description
For example in CevalFunction.evaluateWhileStatement (modified on line 1438):
case (_, _, _, _, _, st) equation (cache, Values.BOOL(boolean = b), st) = cevalExp(inCondition, inCache, inEnv, st); if b then (cache, env, loop_ctrl, st) = evaluateStatements(inStatements, cache, inEnv, st); (cache, env, loop_ctrl, st) = evaluateWhileStatement(inCondition, inStatements, cache, env, loop_ctrl, st); else loop_ctrl = NEXT(); // env = inEnv; end if; then (cache, env, loop_ctrl, st);
env is not defined in the else branch.
This will compile code and for some models () will just crash.
Comment out env = inEnv;
in the else branch and run the testsuite.
Note:
See TracTickets
for help on using tickets.