From 86e77d1609579febe98a2b58946fae29f86ba0c2 Mon Sep 17 00:00:00 2001 From: nitrix Date: Sat, 7 Mar 2020 00:11:48 +0100 Subject: [PATCH] update the struct definition when following the path --- src/main/java/de/hsrm/compiler/Klang/visitors/GenASM.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/de/hsrm/compiler/Klang/visitors/GenASM.java b/src/main/java/de/hsrm/compiler/Klang/visitors/GenASM.java index 5f3169c..b11ad0a 100644 --- a/src/main/java/de/hsrm/compiler/Klang/visitors/GenASM.java +++ b/src/main/java/de/hsrm/compiler/Klang/visitors/GenASM.java @@ -822,6 +822,7 @@ public class GenASM implements Visitor { this.ex.write(" movq " + Helper.getFieldOffset(structDef, e.path[0]) + "(%rax), %rax\n"); for (int i = 1; i < e.path.length; i++) { // "follow" the current path element + structDef = this.structs.get(structDef.fields[Helper.getFieldIndex(structDef, e.path[i])].type.getName()); this.ex.write(" movq " + Helper.getFieldOffset(structDef, e.path[i]) + "(%rax), %rax\n"); }