Skip to content

Commit

Permalink
Fix anyString for SOME().
Browse files Browse the repository at this point in the history
Belonging to [master]:
  - OpenModelica/OMCompiler#2796
  • Loading branch information
perost authored and OpenModelica-Hudson committed Nov 23, 2018
1 parent f5cbc6b commit 0fa8007
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions SimulationRuntime/c/meta/meta_modelica.c
Expand Up @@ -337,14 +337,14 @@ inline static mmc_sint_t anyStringWork(void* any, mmc_sint_t ix, modelica_metaty
}

if (numslots > 0 && ctor == 0) { /* TUPLE */
/* Pointers.mo, pointer are saved as tuples, check if we have it in the stack so we break the cycle */
data = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(any),1));
if (listMember(data, stack))
{
/* Pointers.mo, pointer are saved as tuples, check if we have it in the stack so we break the cycle */
data = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(any),1));
if (listMember(data, stack))
{
checkAnyStringBufSize(ix,12);
ix += sprintf(anyStringBuf+ix, "(Pointer())");
return ix;
}
}
checkAnyStringBufSize(ix,2);
ix += sprintf(anyStringBuf+ix, "(");
for (i = 0; i < numslots; i++) {
Expand All @@ -369,7 +369,7 @@ inline static mmc_sint_t anyStringWork(void* any, mmc_sint_t ix, modelica_metaty
if (numslots==1 && ctor==1) /* SOME(x) */ {
checkAnyStringBufSize(ix,6);
ix += sprintf(anyStringBuf+ix, "SOME(");
ix = anyStringWork(data, ix, stack);
ix = anyStringWork(MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(any), 1)), ix, stack);
checkAnyStringBufSize(ix,2);
ix += sprintf(anyStringBuf+ix, ")");
return ix;
Expand Down

0 comments on commit 0fa8007

Please sign in to comment.