-
-
Notifications
You must be signed in to change notification settings - Fork 755
fix(codegen): prevent arithmetic overflow calculating quote for StringLiterals
#10102
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
Merged
graphite-app
merged 1 commit into
main
from
03-28-fix_codegen_prevent_arithmetic_overflow_calculating_quote_for_stringliteral_s
Mar 29, 2025
Merged
fix(codegen): prevent arithmetic overflow calculating quote for StringLiterals
#10102
graphite-app
merged 1 commit into
main
from
03-28-fix_codegen_prevent_arithmetic_overflow_calculating_quote_for_stringliteral_s
Mar 29, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This was referenced Mar 28, 2025
Merged
Member
Author
CodSpeed Instrumentation Performance ReportMerging #10102 will not alter performanceComparing Summary
|
7bdf93b to
16b3916
Compare
92a03b8 to
d3afce0
Compare
16b3916 to
3511357
Compare
Contributor
Merge activity
|
…ngLiteral`s (#10102) Code for calculating the optimum quote character to use for `StringLiteral`s could in theory produce arithmetic overflow (panic in debug mode, malfunction in release mode) if the string is very long and contains a very large number of quote characters e.g. `"''''''''''''"` (but much much longer). Fix that by using `i64` instead of `i32` for the counter variables.
3511357 to
d190466
Compare
d3afce0 to
c903e42
Compare
Base automatically changed from
03-27-perf_codegen_faster_printing_quotes
to
main
March 29, 2025 13:09
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.

Code for calculating the optimum quote character to use for
StringLiterals could in theory produce arithmetic overflow (panic in debug mode, malfunction in release mode) if the string is very long and contains a very large number of quote characters e.g."''''''''''''"(but much much longer).Fix that by using
i64instead ofi32for the counter variables.