You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 18, 2019. It is now read-only.
The code generator gave the wrong variable indexes for aliases that
were not replaced in the backend. This prints some warnings or errors
for these cases so we can either fix the code (or replace the code
generator to handle aliases better).
Belonging to [master]:
- #2076
- OpenModelica/OpenModelica-testsuite#810
if debug then execStat("ReduceDAE: reduceTerms"); end if;
423
-
end if;
424
-
end if;
421
+
Flags.disableDebug(Flags.REDUCE_DAE);
422
+
if debug then execStat("ReduceDAE: reduceTerms"); end if;
423
+
end if;
424
+
end if;
425
425
// external objects
426
426
extObjInfo := createExtObjInfo(shared);
427
427
@@ -13319,6 +13319,19 @@ algorithm
13319
13319
case (cref, SimCode.SIMCODE(crefToSimVarHT = crefToSimVarHT) )
13320
13320
equation
13321
13321
sv = BaseHashTable.get(cref, crefToSimVarHT);
13322
+
sv = match sv.aliasvar
13323
+
case SimCodeVar.NOALIAS() then sv;
13324
+
/* The C++ runtime generates a different set of variables... */
13325
+
case _ guard Config.simCodeTarget() == "Cpp" then sv;
13326
+
case SimCodeVar.ALIAS(varName=cref)
13327
+
algorithm
13328
+
Error.addSourceMessage(Error.COMPILER_WARNING, {getInstanceName() + " got an alias variable " + ComponentReference.printComponentRefStr(inCref) + " to " + ComponentReference.printComponentRefStr(cref) + ", but before code generation these should have been removed"}, sv.source.info);
13329
+
then cref2simvar(cref, simCode);
13330
+
case SimCodeVar.NEGATEDALIAS(varName=cref)
13331
+
algorithm
13332
+
Error.addSourceMessage(Error.INTERNAL_ERROR, {getInstanceName() + " got a negated alias variable " + ComponentReference.printComponentRefStr(inCref) + " to " + ComponentReference.printComponentRefStr(cref) + ", but before code generation these should have been removed"}, sv.source.info);
0 commit comments