Skip to content

Commit

Permalink
- Fix compilation of ASUB in non-function context, too
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@12509 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Aug 14, 2012
1 parent b4926da commit f57b222
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions Compiler/Template/CodegenC.tpl
Expand Up @@ -6519,7 +6519,7 @@ template daeExpAsub(Exp inExp, Context context, Text &preExp /*BUFP*/,
arrName
case PARALLEL_FUNCTION_CONTEXT(__) then
arrName
else
else
arrayScalarRhs(ecr.ty, subs, arrName, context, &preExp, &varDecls)

case ASUB(exp=e, sub=indexes) then
Expand Down Expand Up @@ -6892,14 +6892,13 @@ template arrayScalarRhs(Type ty, list<Exp> subs, String arrName, Context context
'arrayGet(<%arrName%>,<%dimsValuesStr%>) /*arrayScalarRhs*/'
else
match context
case FUNCTION_CONTEXT(__) then
<<
(*<%arrayType%>_element_addr(&<%arrName%>, <%dimsLenStr%>, <%dimsValuesStr%>))
>>
case PARALLEL_FUNCTION_CONTEXT(__) then
<<
(*<%arrayType%>_element_addr_c99_<%dimsLenStr%>(&<%arrName%>, <%dimsLenStr%>, <%dimsValuesStr%>))
>>
else
'(*<%arrayType%>_element_addr(&<%arrName%>, <%dimsLenStr%>, <%dimsValuesStr%>))'

end arrayScalarRhs;

template daeExpList(Exp exp, Context context, Text &preExp /*BUFP*/,
Expand Down

0 comments on commit f57b222

Please sign in to comment.