update the struct definition when following the path

This commit is contained in:
2020-03-07 00:11:48 +01:00
parent eb75cc7838
commit 86e77d1609

View File

@@ -822,6 +822,7 @@ public class GenASM implements Visitor<Void> {
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");
}