Preprocessor: fix possible bug in histval (need to limit search of aux vars to aux vars for lagged vars, otherwise we could have a wrong match with some other kind)

time-shift
Sébastien Villemot 2010-10-20 11:39:09 +02:00
parent 057908baf6
commit 7f59b8074c
1 changed files with 2 additions and 1 deletions

View File

@ -371,7 +371,8 @@ int
SymbolTable::searchAuxiliaryVars(int orig_symb_id, int orig_lead_lag) const
{
for (int i=0; i < aux_vars.size();++i)
if ((aux_vars[i].get_orig_symb_id() == orig_symb_id) && (aux_vars[i].get_orig_lead_lag() == orig_lead_lag))
if ((aux_vars[i].get_type() == avEndoLag || aux_vars[i].get_type() == avExoLag)
&& aux_vars[i].get_orig_symb_id() == orig_symb_id && aux_vars[i].get_orig_lead_lag() == orig_lead_lag)
return aux_vars[i].get_symb_id();
return -1;
}