-
Notifications
You must be signed in to change notification settings - Fork 6k
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
Testing code generation errors #15612
Conversation
throw Error( | ||
2202_error, | ||
Error::Type::CodeGenerationError, | ||
"Code section too large for EOF." | ||
); |
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.
@rodiazet Once this PR gets merged, this is how EOF errors triggerable by user code should be reported.
The analyzer checks for the number of subs and functions should be replaced with this.
0abfe3a
to
812efab
Compare
13b4f30
to
126b33f
Compare
812efab
to
609fd43
Compare
6cab972
to
0d31dde
Compare
609fd43
to
4d3140e
Compare
0d31dde
to
dce96ab
Compare
48fd3d0
to
29c2a39
Compare
dce96ab
to
24dcbc6
Compare
29c2a39
to
f1e44cf
Compare
24dcbc6
to
336001a
Compare
e797b3c
to
fcbfbf5
Compare
336001a
to
0ae3cef
Compare
fcbfbf5
to
9acd665
Compare
0ae3cef
to
f59e518
Compare
9acd665
to
3d8ff6b
Compare
f59e518
to
81e56aa
Compare
3d8ff6b
to
2f4d58f
Compare
2f4d58f
to
46b0616
Compare
81e56aa
to
ef2a623
Compare
ef2a623
to
c6179ea
Compare
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.
Just a question about a minor detail.
1b82389
to
ba35d52
Compare
2115f2a
to
c158522
Compare
d5ff624
to
3966f44
Compare
c158522
to
bb9d694
Compare
3966f44
to
43b84f0
Compare
Depends on #15611.Merged.Depends on #15667.Merged.The PR makes it possible to create Yul syntax tests that cover code generation errors. We only had one such error until now (access to an uninitialized immutable), but with EOF they will be much more common due to the limits imposed by the format that cannot be checked before bytecode generation. Treating those as ICEs is not acceptable. They must be properly reported to the user as errors and also covered with tests.
In this PR I'm making Yul syntax tests not stop after parsing but actually proceed with optimization and assembling. We already do the same thing in Solidity syntax tests.
The PR then adds code generation errors and tests for two EOF cases to make sure the new mechanism works properly.