Skip to content

Commit 8594c6f

Browse files
committed
Added function Global.initialize() to init roots that are expected to have a default value
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@16557 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
1 parent b93853f commit 8594c6f

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

Compiler/Global/Global.mo

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ encapsulated package Global
3434
package: Global
3535
description: Global contains structures that are available globally.
3636
37-
RCS: $Id: Global.mo 8980 2011-05-13 09:12:21Z adrpo $
37+
RCS: $Id$
3838
3939
The Global package contains structures that are available globally."
4040

@@ -51,4 +51,9 @@ constant Integer flagsIndex = 7;
5151
constant Integer builtinGraphEnvIndex = 8;
5252
constant Integer instOnlyForcedFunctions = 9;
5353

54+
public function initialize "Called to initialize global roots (when needed)"
55+
algorithm
56+
setGlobalRoot(instOnlyForcedFunctions, NONE());
57+
end initialize;
58+
5459
end Global;

Compiler/Main/Main.mo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1035,7 +1035,7 @@ algorithm
10351035
_ := matchcontinue args
10361036
case _
10371037
equation
1038-
setGlobalRoot(Global.instOnlyForcedFunctions, NONE());
1038+
Global.initialize();
10391039
System.realtimeTick(CevalScript.RT_CLOCK_SIMULATE_TOTAL);
10401040
args_1 = Flags.new(args);
10411041
System.gettextInit(Util.if_(Config.getRunningTestsuite(),"C",Flags.getConfigString(Flags.LOCALE_FLAG)));

0 commit comments

Comments
 (0)