aboutsummaryrefslogtreecommitdiff
path: root/pc.y
diff options
context:
space:
mode:
authorTucker Evans <tuckerevans24@gmail.com>2019-09-30 18:40:56 -0400
committerTucker Evans <tuckerevans24@gmail.com>2019-09-30 18:40:56 -0400
commit46fa458c879ab784f6e320fdf793dd4294efcd56 (patch)
treea4018e3c235017725ca17ffed1b8f8d611f3036a /pc.y
parent8e354d0b3d76eac27fe2c533db275e21f983b8dd (diff)
Fix check_exists checks safe scopes not just current
Diffstat (limited to 'pc.y')
-rw-r--r--pc.y6
1 files changed, 4 insertions, 2 deletions
diff --git a/pc.y b/pc.y
index 07f753f..da58fb5 100644
--- a/pc.y
+++ b/pc.y
@@ -359,13 +359,15 @@ TD
var
:ID
{
- $$ = mkid(scope_safe_search(cur_scope,$1));
+ node *tmp;
+ tmp = check_exists(cur_scope, $1);
+ $$ = mkid(tmp);
free($1);
}
|ID '[' expr ']'
{
node* tmp;
- tmp = scope_safe_search(cur_scope, $1);
+ tmp = check_exists(cur_scope, $1);
$$ = mktree(ARRAY_ACCESS, mkid(tmp), $3);
$$->attr.nval = $$->l->attr.nval;