﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
6115	Wrong code generation for *and*	Adrian Pop	Mahder Alemseged Gebremedhin	"
The condition in the when:
{{{#!mo
when (index > 0) and (time >= Array[index])
  ...
end when
}}}
is translated to:
{{{#!c
  tmp1 = Greater(data->localData[0]->integerVars[1] /* index DISCRETE */,((modelica_integer) 0));
  tmp2 = GreaterEq(data->localData[0]->timeValue, (&data->localData[0]->realVars[1] /* Array[1] variable */)[calc_base_index_dims_subs(1, 10, data->localData[0]->integerVars[1] /* index DISCRETE */)]);
  data->localData[0]->booleanVars[1] /* $whenCondition1 DISCRETE */ = (tmp1 && tmp2);
}}}
which will generate an error:
{{{
assert            | error   | Dimension 1 has bounds 1..10, got array subscript 0
assert            | info    | simulation terminated by an assertion at initialization
}}}

The first condition should be checked before the second one!"	defect	new	high	Future	Code Generation				
