Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Compiler/src/tfuncs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,7 @@ function pointer_eltype(@nospecialize(ptr))
end

@nospecs function pointerarith_tfunc(𝕃::AbstractLattice, ptr, offset)
return ptr
return widenconst(ptr)
end
@nospecs function pointerref_tfunc(𝕃::AbstractLattice, a, i, align)
return pointer_eltype(a)
Expand Down
7 changes: 7 additions & 0 deletions Compiler/test/effects.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1486,3 +1486,10 @@ let effects = Base.infer_effects((Core.SimpleVector,Int); optimize=false) do sve
end

@test Compiler.is_nothrow(Base.infer_effects(length, (Core.SimpleVector,)))


# https://github.com/JuliaLang/julia/issues/60009
function null_offset(offset)
Ptr{UInt8}(C_NULL) + offset
end
@test null_offset(Int(100)) == Ptr{UInt8}(UInt(100))