From a0f4c34a062fcbbdf3c1e0c93e6cb6bbee865843 Mon Sep 17 00:00:00 2001 From: Curtis Vogt Date: Wed, 30 Sep 2020 13:02:42 -0500 Subject: [PATCH] Fix invalidation with `pointer(::String, ::Integer)` --- base/strings/string.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/strings/string.jl b/base/strings/string.jl index 1ebb85ff78dd2..a5a1c887272c2 100644 --- a/base/strings/string.jl +++ b/base/strings/string.jl @@ -92,7 +92,7 @@ String(s::CodeUnits{UInt8,String}) = s.s ## low-level functions ## pointer(s::String) = unsafe_convert(Ptr{UInt8}, s) -pointer(s::String, i::Integer) = pointer(s)+(i-1) +pointer(s::String, i::Integer) = pointer(s) + Int(i)::Int - 1 @pure ncodeunits(s::String) = Core.sizeof(s) codeunit(s::String) = UInt8