From 5063e5b1218ab6b3780fdbd534615009f1a965b9 Mon Sep 17 00:00:00 2001
From: Xun Yang <x299yang@uwaterloo.ca>
Date: Fri, 6 Mar 2020 15:23:07 -0500
Subject: [PATCH] small fix on localvar field access

---
 NameNode.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/NameNode.py b/NameNode.py
index 19a6368..087f3f7 100644
--- a/NameNode.py
+++ b/NameNode.py
@@ -182,6 +182,8 @@ class NameNode(ASTNode):
                             self.myType = TypeStruct("int", None)
                             return
                         else:
+                            if curType.__class__.__name__ in ['ParamNode', 'VarDclNode']:
+                                curType = curType.myType.typePointer
                             curType = curType.env.getNode(self.IDs[0], 'fieldDcl')
                     # for methods, we want to keep prefixLink pointing to the class for getting method later
                 else:
-- 
GitLab