Skip to content

Commit cb068c2

Browse files
timholytopolarity
andauthored
Update contrib/juliac/juliac-buildscript.jl
Co-authored-by: Cody Tapscott <[email protected]>
1 parent 106868a commit cb068c2

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

contrib/juliac/juliac-buildscript.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ const C_friendly_types = Base.IdSet{Any}([ # a few of these are redundant to
3535
])
3636

3737
function recursively_add_types!(types::Base.IdSet{DataType}, @nospecialize(T::DataType))
38-
if T C_friendly_types
39-
if T <: Ptr
40-
return recursively_add_types!(types, T.parameters[1])
41-
end
42-
T.name.module === Core && error("invalid type for juliac: ", T) # exclude internals (they may change)
43-
push!(types, T)
38+
while T <: Ptr
39+
T = T.parameters[1] # unwrap Ptr{...}
40+
end
41+
if T.name.module === Core && T C_friendly_types
42+
error("invalid type for juliac: ", T) # exclude internals (they may change)
4443
end
44+
push!(types, T)
4545
for list in (T.parameters, fieldtypes(T))
4646
for S in list
4747
recursively_add_types!(types, S)

0 commit comments

Comments
 (0)