Skip to content

Commit 07ff9a9

Browse files
authored
add an extra inbounds in nextind to prevent a gc frame (#35827)
* add an extra inbounds in nextind to prevent a gc frame * another inbounds
1 parent 403920e commit 07ff9a9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

base/strings/string.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,8 @@ end
144144
@inbounds l = codeunit(s, i)
145145
(l < 0x80) | (0xf8 l) && return i+1
146146
if l < 0xc0
147-
i′ = thisind(s, i)
148-
return i′ < i ? nextind(s, i′) : i+1
147+
i′ = @inbounds thisind(s, i)
148+
return i′ < i ? @inbounds(nextind(s, i′)) : i+1
149149
end
150150
# first continuation byte
151151
(i += 1) > n && return i

0 commit comments

Comments
 (0)