Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
text
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Glasgow Haskell Compiler
Packages
text
Commits
2925921b
Commit
2925921b
authored
10 years ago
by
bos
Browse files
Options
Downloads
Patches
Plain Diff
Reset the lazy decoder state consistently if an error occurs
This fixes gh-87.
parent
e661fd8e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Data/Text/Encoding.hs
+1
-1
1 addition, 1 deletion
Data/Text/Encoding.hs
with
1 addition
and
1 deletion
Data/Text/Encoding.hs
+
1
−
1
View file @
2925921b
...
...
@@ -267,6 +267,7 @@ streamDecodeUtf8With onErr = decodeChunk B.empty 0 0
UTF8_REJECT
->
do
-- We encountered an encoding error
x
<-
peek
curPtr'
poke
statePtr
0
case
onErr
desc
(
Just
x
)
of
Nothing
->
loop
$
curPtr'
`
plusPtr
`
1
Just
c
->
do
...
...
@@ -274,7 +275,6 @@ streamDecodeUtf8With onErr = decodeChunk B.empty 0 0
w
<-
unsafeSTToIO
$
unsafeWrite
dest
(
fromIntegral
destOff
)
(
safe
c
)
poke
destOffPtr
(
destOff
+
fromIntegral
w
)
poke
statePtr
0
loop
$
curPtr'
`
plusPtr
`
1
_
->
do
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment