From 6d3f5892ac40a8a28291a5bf117d345c83061a1b Mon Sep 17 00:00:00 2001 From: Christian Femers Date: Mon, 2 Sep 2019 03:18:48 +0200 Subject: [PATCH] Fixed stack high level state internal return type (BitVector[]) --- .../mograsim/logic/model/am2900/components/GUIram5_12.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/components/GUIram5_12.java b/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/components/GUIram5_12.java index d1871f45..adce29a0 100644 --- a/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/components/GUIram5_12.java +++ b/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/components/GUIram5_12.java @@ -106,7 +106,9 @@ public class GUIram5_12 extends SimpleRectangularHardcodedGUIComponent BitVector newHighLevelStateCasted = (BitVector) newHighLevelState; if (newHighLevelStateCasted.length() != 12) throw new IllegalArgumentException("Expected BitVector of length 12, not " + newHighLevelStateCasted.length()); - return ((BitVector[]) lastState)[addr] = newHighLevelStateCasted; + BitVector[] memC = (BitVector[]) lastState; + memC[addr] = newHighLevelStateCasted; + return memC; } return super.setHighLevelState(lastState, stateID, newHighLevelState); } -- 2.17.1