Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parsers reads out of bounds in checkdelim! #156

Closed
KristofferC opened this issue Jan 4, 2023 · 0 comments · Fixed by #157
Closed

Parsers reads out of bounds in checkdelim! #156

KristofferC opened this issue Jan 4, 2023 · 0 comments · Fixed by #157

Comments

@KristofferC
Copy link
Contributor

❯ julia --check-bounds=yes --compiled-modules=no
julia> using Parsers

julia> Parsers.checkdelim!(codeunits("::::"), 1, 4, Parsers.Options(delim = "::", ignorerepeated = true)) == 5
ERROR: BoundsError: attempt to access 4-codeunit String at index [5]
Stacktrace:
 [1] checkbounds
   @ ./strings/basic.jl:216 [inlined]
 [2] codeunit
   @ ./strings/string.jl:117 [inlined]
 [3] getindex
   @ ./strings/basic.jl:756 [inlined]
 [4] peekbyte
   @ ~/.julia/packages/Parsers/gi2J3/src/utils.jl:345 [inlined]
 [5] checkdelim!(source::Base.CodeUnits{UInt8, String}, pos::Int64, len::Int64, options::Parsers.Options)
   @ Parsers ~/.julia/packages/Parsers/gi2J3/src/Parsers.jl:375
 [6] top-level scope
   @ REPL[2]:1

(running with --compiled-modules=no to make sure no precompile file with bounds checking turned off is cached)

quinnj added a commit that referenced this issue Jan 4, 2023
quinnj added a commit that referenced this issue Jan 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant