Skip to content

Commit

Permalink
Copy entire array when a dimension is unknown
Browse files Browse the repository at this point in the history
Only copying the data only works if the array has allocated the
correct amount of memory.
  • Loading branch information
sjoelund authored and OpenModelica-Hudson committed Dec 16, 2016
1 parent 334f2f6 commit 9fabde5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Compiler/Template/CodegenCFunctions.tpl
Expand Up @@ -2664,7 +2664,7 @@ match lhsexp
let type = expTypeArray(ty)
if crefSubIsScalar(cr) then
let lhsStr = daeExpCrefLhs(lhsexp, context, &preExp, &varDecls, &auxFunction, false)
'copy_<%type%>_data(<%rhsExpStr%>, &<%lhsStr%>);'
'copy_<%type%><%if isArrayWithUnknownDimension(ty) then "" else "_data"%>(<%rhsExpStr%>, &<%lhsStr%>);'
else
indexedAssign(lhsexp, rhsExpStr, context, &preExp, &varDecls, &auxFunction)
end algStmtAssignArrWithRhsExpStr;
Expand Down

0 comments on commit 9fabde5

Please sign in to comment.