Skip to content

Commit

Permalink
Merge pull request #40319 from JuliaLang/jq/40318
Browse files Browse the repository at this point in the history
Fix #40318 by using UInt to convert instead of Int on Ptr
  • Loading branch information
quinnj authored Apr 2, 2021
2 parents 8c3164c + 5332d7d commit 31b66d5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion stdlib/Printf/src/Printf.jl
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ const __BIG_FLOAT_MAX__ = 8192
end

# pointers
fmt(buf, pos, arg, spec::Spec{Pointer}) = fmt(buf, pos, Int(arg), ptrfmt(spec, arg))
fmt(buf, pos, arg, spec::Spec{Pointer}) = fmt(buf, pos, UInt64(arg), ptrfmt(spec, arg))

# old Printf compat
function fix_dec end
Expand Down
3 changes: 3 additions & 0 deletions stdlib/Printf/test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ using Test, Printf
@test (@sprintf "%-20p" C_NULL) == "0x00000000 "
end

#40318
@test @sprintf("%p", 0xfffffffffffe0000) == "0xfffffffffffe0000"

end

@testset "%a" begin
Expand Down

0 comments on commit 31b66d5

Please sign in to comment.