-
-
Notifications
You must be signed in to change notification settings - Fork 128
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
fix(codegen/regex): allow vec growth on parse #405
Conversation
Hello @LeoDog896, thank you for your contribution! Can you motivate why we need to have a possibly growing vector instead? |
Yep! I'll write this in a comment soon, but the original vec allocation never accounted for the size of the literals - it always assumed every ropable element would only have one item, and each item would be four Unicode codepoints long; since literals can be longer than four Unicode points, if there was more than eight tokens (two being the minimum size to create a concat literal), it would cause that integer overflow error. The only way to get that size would be to walk through all the elements in the concat node and add up the lengths of all of these elements. |
Sorry for the late review @LeoDog896, I was on holidays. This looks great and clear to me. Before I merge this, did you check that |
On current |
Looks good, thanks! |
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [logos](https://logos.maciej.codes/) ([source](https://redirect.github.com/maciejhirsz/logos)) | dependencies | patch | `0.14.1` -> `0.14.2` | --- ### Release Notes <details> <summary>maciejhirsz/logos (logos)</summary> ### [`v0.14.2`](https://redirect.github.com/maciejhirsz/logos/releases/tag/v0.14.2): - Optional `forbid_unsafe` feature, fuzzing, book, and more! [Compare Source](https://redirect.github.com/maciejhirsz/logos/compare/v0.14.1...v0.14.2) #### What's Changed - chore(book): added link to Rust's reference by [@​CommanderStorm](https://redirect.github.com/CommanderStorm) in [https://github.com/maciejhirsz/logos/pull/411](https://redirect.github.com/maciejhirsz/logos/pull/411) - feat: impl Source for T: Deref in no_std by [@​yjhmelody](https://redirect.github.com/yjhmelody) in [https://github.com/maciejhirsz/logos/pull/406](https://redirect.github.com/maciejhirsz/logos/pull/406) - fix(codegen/regex): allow vec growth on parse by [@​LeoDog896](https://redirect.github.com/LeoDog896) in [https://github.com/maciejhirsz/logos/pull/405](https://redirect.github.com/maciejhirsz/logos/pull/405) - test: basic fuzzing by [@​LeoDog896](https://redirect.github.com/LeoDog896) in [https://github.com/maciejhirsz/logos/pull/407](https://redirect.github.com/maciejhirsz/logos/pull/407) - feat(lib): add `forbid_unsafe` feature to disable unsafe code by [@​davidkern](https://redirect.github.com/davidkern) in [https://github.com/maciejhirsz/logos/pull/413](https://redirect.github.com/maciejhirsz/logos/pull/413) - chore(version): release v0.14.2 by [@​jeertmans](https://redirect.github.com/jeertmans) in [https://github.com/maciejhirsz/logos/pull/422](https://redirect.github.com/maciejhirsz/logos/pull/422) #### New Contributors - [@​CommanderStorm](https://redirect.github.com/CommanderStorm) made their first contribution in [https://github.com/maciejhirsz/logos/pull/411](https://redirect.github.com/maciejhirsz/logos/pull/411) - [@​yjhmelody](https://redirect.github.com/yjhmelody) made their first contribution in [https://github.com/maciejhirsz/logos/pull/406](https://redirect.github.com/maciejhirsz/logos/pull/406) - [@​davidkern](https://redirect.github.com/davidkern) made their first contribution in [https://github.com/maciejhirsz/logos/pull/413](https://redirect.github.com/maciejhirsz/logos/pull/413) **Full Changelog**: maciejhirsz/logos@v0.14.1...v0.14.2 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/akrantz01/antsi). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC44MC4wIiwidXBkYXRlZEluVmVyIjoiMzguODAuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Fixes #389. This is less efficient, but it's on codegen.