﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
2907	Inner model with algorithm fails	crupp@…	somebody	"Using the nightly build 22761, the following script fails under the given circumstances:

{{{
loadString(""model inner_bug
  inner global glb;
end inner_bug;

model global
initial algorithm
  func();
end global;

function func
end func;"");

// This works
simulate(inner_bug);

// This fails
simulate(inner_bug, simflags=""-lv=LOG_STATS"");
}}}

The model runs without ""-lv=LOG_STATS"", but fails with it. The error returned is:

{{{
    messages = \""Simulation execution failed for model: inner_bug
assert            | debug   | simulation/simulation_info_xml.c: Info XML inner_bug_info.xml got equation with index 3, expected 1
\""
}}}

Also, if ""algorithm"" is used instead of ""initial algorithm"" in model global, then the error is:

{{{
    messages = \""Simulation execution failed for model: inner_bug
Assertion failed: xml->nEquations == userData.curIndex, file simulation/simulation_info_xml.c, line 298

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
\""
}}}

These issues have only appeared since build r21961."	defect	closed	high	1.9.4	*unknown*	trunk	fixed		
