Skip to content

Commit

Permalink
Fix broken module-scope struct/array reference type checking.
Browse files Browse the repository at this point in the history
  • Loading branch information
TDRRmk2 committed Feb 4, 2025
1 parent 14bb9b2 commit 33ca688
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/semantic/type.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) );
}

Expand Down

0 comments on commit 33ca688

Please sign in to comment.