Skip to content

Commit

Permalink
fix for assert in cpp template
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@23267 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
niklwors committed Nov 7, 2014
1 parent 6aeb900 commit 68693d6
Showing 1 changed file with 21 additions and 8 deletions.
29 changes: 21 additions & 8 deletions Compiler/Template/CodegenCpp.tpl
Expand Up @@ -8109,9 +8109,9 @@ template generateDelteAlgloopsolverVariables2(SimEqSystem eq, Context context, T
if(_conditions0<%num%>)
delete [] _conditions0<%num%>;
if(_conditions1<%num%>)
delete _conditions1<%num%>;
delete [] _conditions1<%num%>;
if(_algloop<%num%>Vars)
delete _algloop<%num%>Vars;
delete [] _algloop<%num%>Vars;
>>
end match
else
Expand Down Expand Up @@ -10131,14 +10131,27 @@ template assertCommon(Exp condition, Exp message, Context context, Text &varDecl
>>
*/
<<
<%preExpCond%>
<%preExpMsg%>

<%if msgVar then
<<if(!<%condVar%>)
throw std::runtime_error(<%msgVar%>);>>
<<
if(!<%condVar%>)
{
<%preExpCond%>
<%preExpMsg%>
throw std::runtime_error(<%msgVar%>);
}
>>
else
<<if(!<%condVar%>)
throw std::runtime_error();>>%>
<<
if(!<%condVar%>)
{
<%preExpCond%>
<%preExpMsg%>
throw std::runtime_error();
}
>>
%>
>>

end assertCommon;
Expand Down

0 comments on commit 68693d6

Please sign in to comment.