diff --git a/interpreter/src/main/java/org/intocps/maestro/interpreter/Fmi2Interpreter.java b/interpreter/src/main/java/org/intocps/maestro/interpreter/Fmi2Interpreter.java index 7af5b06a..cdadb765 100644 --- a/interpreter/src/main/java/org/intocps/maestro/interpreter/Fmi2Interpreter.java +++ b/interpreter/src/main/java/org/intocps/maestro/interpreter/Fmi2Interpreter.java @@ -500,7 +500,7 @@ public static FmuComponentValue getFmuComponentValue(BufferedOutputStream fmuLog Value v = fcargs.get(0).deref(); Value sizeValue = fcargs.get(1); - if (v instanceof FmuComponentStateValue && sizeValue.isNumeric()) { + if (v instanceof FmuComponentStateValue && sizeValue.deref().isNumeric()) { try { FmuComponentStateValue stateValue = (FmuComponentStateValue) v; FmuResult res = component.getSerializedFMUstateSize(stateValue.getModule()); @@ -567,7 +567,7 @@ public static FmuComponentValue getFmuComponentValue(BufferedOutputStream fmuLog Value sizeValue = fcargs.get(1).deref(); Value stateValue = fcargs.get(2); - if (stateValue instanceof FmuComponentStateValue && sizeValue.isNumeric()) { + if ( sizeValue.isNumeric()) { try { NumericValue size = (NumericValue) sizeValue; ArrayValue byteArray = (ArrayValue) bytesValue; diff --git a/interpreter/src/main/java/org/intocps/maestro/interpreter/Interpreter.java b/interpreter/src/main/java/org/intocps/maestro/interpreter/Interpreter.java index cc6244ce..4b77b814 100644 --- a/interpreter/src/main/java/org/intocps/maestro/interpreter/Interpreter.java +++ b/interpreter/src/main/java/org/intocps/maestro/interpreter/Interpreter.java @@ -202,7 +202,7 @@ public Value caseANotEqualBinaryExp(ANotEqualBinaryExp node, Context question) t public ArrayValue createArrayValue(List sizes, PType type, Context question) throws AnalysisException { List arrayValues = new ArrayList<>(); - for (int i = 0; i < ((NumericValue) sizes.get(0).apply(this, question)).intValue(); i++) { + for (int i = 0; i < ((NumericValue) sizes.get(0).apply(this, question).deref()).intValue(); i++) { if (sizes.size() > 1) { List nextSizes = sizes.subList(1, sizes.size()); // Call recursively diff --git a/interpreter/src/main/java/org/intocps/maestro/interpreter/values/IntegerValue.java b/interpreter/src/main/java/org/intocps/maestro/interpreter/values/IntegerValue.java index fe5f3299..f65674e8 100644 --- a/interpreter/src/main/java/org/intocps/maestro/interpreter/values/IntegerValue.java +++ b/interpreter/src/main/java/org/intocps/maestro/interpreter/values/IntegerValue.java @@ -48,6 +48,10 @@ public int compareTo(Value other) { if (other instanceof IntegerValue || other instanceof ByteValue || other instanceof ShortValue) { NumericValue io = (NumericValue) other; return (value < io.intValue() ? -1 : (value == io.intValue() ? 0 : 1)); + }else if( other instanceof LongValue) + { + NumericValue io = (NumericValue) other; + return (value < io.longValue() ? -1 : (value == io.longValue() ? 0 : 1)); } return super.compareTo(other);