-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Bug fix for large binary with unlink libraries codegen #2016
Bug fix for large binary with unlink libraries codegen #2016
Conversation
421c84f
to
479c284
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2016 +/- ##
============================================
+ Coverage 69.20% 69.22% +0.01%
- Complexity 3122 3123 +1
============================================
Files 493 493
Lines 13145 13146 +1
Branches 1695 1695
============================================
+ Hits 9097 9100 +3
+ Misses 3557 3556 -1
+ Partials 491 490 -1 ☔ View full report in Codecov by Sentry. |
617016f
to
479c284
Compare
825c439
to
5a7b9aa
Compare
import com.squareup.javapoet.ParameterizedTypeName; | ||
import com.squareup.javapoet.TypeName; | ||
import com.squareup.javapoet.TypeSpec; | ||
import com.squareup.javapoet.*; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove wildcard import
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What does this PR do?
Bug fix for large binary with unlinked libraries codegen
Where should the reviewer start?
All files
Why is it needed?
solidity bytecode with unlinked libraries can contain dollar sign (https://docs.soliditylang.org/en/latest/using-the-compiler.html) in the form of
__$hashed$__
. This could potentially being interpreted as string placeholder for args replacement in Java poet, in the case that cause failure in particular is__$927c5a12e2f339676f56d42ec1c0537964$__
(the $927c part). The code that contain this bug only at the case for large binary (length > 65534). The safest way to fix is just to escape all dollar using javapoet's escape rulesquare/javapoet#670