Skip to content

Commit

Permalink
Fix ReferenceStorage(T) atomic if T has no inner pointers (#14845)
Browse files Browse the repository at this point in the history
It turns out the fix in #14730 made all `ReferenceStorage` objects non-atomic; `Crystal::ReferenceStorageType#reference_type` returns a reference type, whose `#has_inner_pointers?` always returns true since the reference itself is a pointer.
This PR fixes that again by adding a special case for `ReferenceStorage`.
  • Loading branch information
HertzDevil authored Aug 6, 2024
1 parent 108285f commit b06aad8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/compiler/crystal/codegen/types.cr
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ module Crystal
when NamedTupleInstanceType
self.entries.any? &.type.has_inner_pointers?
when ReferenceStorageType
self.reference_type.has_inner_pointers?
self.reference_type.all_instance_vars.each_value.any? &.type.has_inner_pointers?
when PrimitiveType
false
when EnumType
Expand Down

0 comments on commit b06aad8

Please sign in to comment.