summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbd-912 <bdunahu@colostate.edu>2024-05-08 03:39:34 -0600
committerbd-912 <bdunahu@colostate.edu>2024-05-08 03:39:34 -0600
commitf59241de07bfc0170fe3a18dc279d2a66bd58fdb (patch)
treeaf9566224d79b06bd90a511bca20c2ddf82138a4
parentbf6c70d595e194e8688737b39f31d173436163d4 (diff)
Fix bug where allocation expression inside bracket did not set recent
class HeatVisitor
-rw-r--r--heat/HeatVisitor.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/heat/HeatVisitor.java b/heat/HeatVisitor.java
index 243812c..15971d3 100644
--- a/heat/HeatVisitor.java
+++ b/heat/HeatVisitor.java
@@ -10,7 +10,7 @@ public class HeatVisitor extends GJDepthFirst<TypeBundle,ArrayList<TypeBundle>>
private SymbolTable symt;
- private MethodInstance recentMethod = null; // the most recent method called
+ private ClassInstance recentClass = null; // the most recent method called
public HeatVisitor(SymbolTable symt) {
this.symt = symt;
@@ -799,7 +799,7 @@ public class HeatVisitor extends GJDepthFirst<TypeBundle,ArrayList<TypeBundle>>
case 8:
MinimalLogger.info(String.format("Message send found BRACKET"));
t = new TypeInstance("null",null,null,null);
- ClassInstance c = this.recentMethod.getReturn();
+ ClassInstance c = this.recentClass;
MinimalLogger.info(String.format("Setting class to the most recent return: %s",
c.toString()));
t.addClassInstance(c);
@@ -836,7 +836,7 @@ public class HeatVisitor extends GJDepthFirst<TypeBundle,ArrayList<TypeBundle>>
MinimalLogger.info(String.format("The most recently called method is now %s",
m.toString()));
- this.recentMethod = m;
+ this.recentClass = m.getReturn();
String ret = m.getReturn().getName();
if (ret.equals("intarray"))
@@ -1039,6 +1039,7 @@ public class HeatVisitor extends GJDepthFirst<TypeBundle,ArrayList<TypeBundle>>
n.getClass().getSimpleName(),
id));
///////////////////////////////////////////////////////////////
+ this.recentClass = this.symt.getClass(id);
_ret = new TypeBundle(TypeEnum.classname, this.symt.getClass(id));
///////////////////////////////////////////////////////////////
MinimalLogger.info(String.format("<- %s with %s",