Skip to content

Conversation

@jobarr-amzn
Copy link
Contributor

I recently ran into this error through an mdbook build, also reported by someone else here.

Luckily it was pretty straightforward to find and fix :) Thanks for maintaining this repository!

See also:

   Release 2: 11 Apr 2013
       fixes a bug noted by Matt Patenaude <[email protected]>,

       case 'o': if (ends("\03" "ion") && (b[j] == 's' || b[j] == 't')) break;
           ==>
       case 'o': if (ends("\03" "ion") && j >= k0 && (b[j] == 's' || b[j] == 't')) break;

       to avoid accessing b[k0-1] when the word in b is "ion".

See also:
- minhnhdo/rust-stem#9
- Release 2 notes from the reference implementation:
```plain
   Release 2: 11 Apr 2013
       fixes a bug noted by Matt Patenaude <[email protected]>,

       case 'o': if (ends("\03" "ion") && (b[j] == 's' || b[j] == 't')) break;
           ==>
       case 'o': if (ends("\03" "ion") && j >= k0 && (b[j] == 's' || b[j] == 't')) break;

       to avoid accessing b[k0-1] when the word in b is "ion".
```
@jobarr-amzn
Copy link
Contributor Author

Note this does not include the patch from the reference implementation Release 3- I spent a few minutes looking into that and didn't grok the Rust port well enough to get the exact same behavior as the reference implementation. It would be easy to just copy the step2 and step4 subtract overflow guards from rust-stem#9, but that still fails if you add an "ied" => "ied" test case- I'm happy to leave that to posterity. @thecodrr ?

@mattico mattico merged commit 8ae5734 into mattico:master Mar 19, 2025
4 checks passed
@mattico
Copy link
Owner

mattico commented Mar 19, 2025

Thanks! I'll look into the other changes when I can. PRs welcome!

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 this pull request may close these issues.

2 participants