Skip to content
This repository was archived by the owner on May 18, 2019. It is now read-only.

Commit dad39fb

Browse files
perostOpenModelica-Hudson
authored andcommitted
[NF] Fix undefined behaviour due to #4502.
Belonging to [master]: - #2072
1 parent eeb9148 commit dad39fb

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

Compiler/NFFrontEnd/NFInst.mo

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1251,11 +1251,13 @@ function updateComponentVariability
12511251
input output Component.Attributes attr;
12521252
input Class cls;
12531253
input InstNode clsNode;
1254+
protected
1255+
Variability var = attr.variability;
12541256
algorithm
12551257
if referenceEq(attr, NFComponent.DEFAULT_ATTR) and
12561258
Type.isDiscrete(Class.getType(cls, clsNode)) then
12571259
attr := NFComponent.DISCRETE_ATTR;
1258-
elseif attr.variability == Variability.CONTINUOUS and
1260+
elseif var == Variability.CONTINUOUS and
12591261
Type.isDiscrete(Class.getType(cls, clsNode)) then
12601262
attr.variability := Variability.DISCRETE;
12611263
end if;

0 commit comments

Comments
 (0)