Skip to content

Commit

Permalink
absint fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
William Moses committed Dec 7, 2024
1 parent 8e10a0a commit 702235a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
1 change: 1 addition & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ version = "0.13.21"

[deps]
CEnum = "fa961155-64e5-5f13-b03f-caf6b980ea82"
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
EnzymeCore = "f151be2c-9106-41f4-ab19-57ee4f262869"
Enzyme_jll = "7cc45869-7501-5eee-bdea-0790c847d4ef"
GPUCompiler = "61eb1bfa-7361-4325-ad38-22787b887f55"
Expand Down
22 changes: 17 additions & 5 deletions src/absint.jl
Original file line number Diff line number Diff line change
Expand Up @@ -566,10 +566,18 @@ function abs_typeof(
elseif fo > offset
offset = offset - typed_fieldoffset(typ, lasti)
typ = typed_fieldtype(typ, lasti)
@assert Base.isconcretetype(typ)
if !Base.allocatedinline(typ)
legal = false
end
if offset == 0
if !Base.allocatedinline(typ)
if byref != GPUCompiler.BITS_VALUE
legal = false
end
byref = GPUCompiler.MUT_REF
end
else
if !Base.isconcretetype(typ) || !Base.allocatedinline(typ)
legal = false
end
end
seen = true
break
end
Expand Down Expand Up @@ -603,7 +611,11 @@ function abs_typeof(

typ2 = typ
while legal && should_recurse(typ2, value_type(arg), byref, dl)
idx, _ = first_non_ghost(typ2)
if !Base.isconcretetype(typ2)
legal = false
break
end
idx, _ = first_non_ghost(typ2)
if idx != -1
typ2 = typed_fieldtype(typ2, idx)
if Base.allocatedinline(typ2)
Expand Down

0 comments on commit 702235a

Please sign in to comment.