﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
2931	Bootstrapped compiler should check undefined variables in if branches	Adrian Pop	Adrian Pop	"For example in CevalFunction.evaluateWhileStatement (modified on line 1438):
{{{#!mo
    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 (i think it was MoistAir) will just crash.
Comment out {{{env = inEnv;}}} in the else branch and run the testsuite.
"	defect	assigned	high	Future	MetaModelica	trunk			
