diff options
author | geno <gabriele.genovese2@studio.unibo.it> | 2024-07-11 14:30:11 +0200 |
---|---|---|
committer | geno <gabriele.genovese2@studio.unibo.it> | 2024-07-11 14:30:11 +0200 |
commit | 57599a42b863cc48050c137de2ec108aa1d59a44 (patch) | |
tree | 243ae356023fe1c2e749e171a865d1c20a261ab8 /src/ast/nodes/AssignmentNode.java | |
parent | b50c7e99603e9f85d82d700d62c16c4fcef88715 (diff) |
feat: clear stack before halt
Diffstat (limited to 'src/ast/nodes/AssignmentNode.java')
-rw-r--r-- | src/ast/nodes/AssignmentNode.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/ast/nodes/AssignmentNode.java b/src/ast/nodes/AssignmentNode.java index 358d497..13e7a33 100644 --- a/src/ast/nodes/AssignmentNode.java +++ b/src/ast/nodes/AssignmentNode.java @@ -1,8 +1,8 @@ package ast.nodes; import ast.types.*; +import codegen.Label; import java.util.ArrayList; - import semanticanalysis.STentry; import semanticanalysis.SemanticError; import semanticanalysis.SymbolTable; @@ -42,6 +42,8 @@ public class AssignmentNode implements Node { STentry e = ST.lookup(leftAtom.getId()); if (ft != null) { ft.addLocalVar(); + } else { + Label.addGlobalVar(); } if (e == null) { |