Skip to content

Commit

Permalink
Fixed #4492: wrong malloc_atomic for virtual struct
Browse files Browse the repository at this point in the history
  • Loading branch information
asterite committed Jun 3, 2017
1 parent ccda23a commit 7973c43
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/compiler/crystal/codegen/types.cr
Expand Up @@ -71,6 +71,12 @@ module Crystal
self.aliased_type.has_inner_pointers?
when TypeDefType
self.typedef.has_inner_pointers?
when VirtualType
if struct?
self.subtypes.any? &.has_inner_pointers?
else
true
end
when InstanceVarContainer
if struct?
all_instance_vars.each_value.any? &.type.has_inner_pointers?
Expand Down

0 comments on commit 7973c43

Please sign in to comment.