Skip to content

Commit

Permalink
[NF] Fix undefined behaviour due to #4502.
Browse files Browse the repository at this point in the history
Belonging to [master]:
  - OpenModelica/OMCompiler#2072
  • Loading branch information
perost authored and OpenModelica-Hudson committed Dec 11, 2017
1 parent eeb9148 commit dad39fb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Compiler/NFFrontEnd/NFInst.mo
Expand Up @@ -1251,11 +1251,13 @@ function updateComponentVariability
input output Component.Attributes attr;
input Class cls;
input InstNode clsNode;
protected
Variability var = attr.variability;
algorithm
if referenceEq(attr, NFComponent.DEFAULT_ATTR) and
Type.isDiscrete(Class.getType(cls, clsNode)) then
attr := NFComponent.DISCRETE_ATTR;
elseif attr.variability == Variability.CONTINUOUS and
elseif var == Variability.CONTINUOUS and
Type.isDiscrete(Class.getType(cls, clsNode)) then
attr.variability := Variability.DISCRETE;
end if;
Expand Down

0 comments on commit dad39fb

Please sign in to comment.