From 33ca688deb8b6fc54f2c1a7382b0eff578205537 Mon Sep 17 00:00:00 2001 From: Moises Aguirre Date: Tue, 4 Feb 2025 16:21:46 -0400 Subject: [PATCH] Fix broken module-scope struct/array reference type checking. --- src/semantic/type.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/semantic/type.c b/src/semantic/type.c index 4b8d6be..2642bef 100755 --- a/src/semantic/type.c +++ b/src/semantic/type.c @@ -221,11 +221,11 @@ static bool same_ref( struct ref* a, struct ref* b ) { } static bool same_ref_struct( struct ref_struct* a, struct ref_struct* b ) { - return ( (a->storage == b->storage) && (a->storage_index == b->storage_index) ); + return ( (a->storage == b->storage) && ( (a->storage == STORAGE_MAP) || (a->storage_index == b->storage_index)) ); } static bool same_ref_array( struct ref_array* a, struct ref_array* b ) { - return ( (a->dim_count == b->dim_count) && (a->storage == b->storage) && (a->storage_index == b->storage_index) && + return ( (a->dim_count == b->dim_count) && (a->storage == b->storage) && ( (a->storage == STORAGE_MAP) || (a->storage_index == b->storage_index)) && (a->ref.nullable == b->ref.nullable) && (a->ref.question_mark == b->ref.question_mark) ); }