Skip to content
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

uint[1.111111E1111111111111] causes compiler to go into infinite loop #831

Merged
merged 3 commits into from
May 12, 2022

Conversation

seanyoung
Copy link
Contributor

The lexer tries to calculate 10^1111111111111 which will be a very large number. This will take a long time.

The lexer should not try to calculate numbers from strings, as this might fail and we do not want the lexer to give up, as no parsing and semantic analysis will be done.

Fixes #829

These were removed in solc 0.7.0, and now no longer reserved keywords.

Signed-off-by: Sean Young <sean@mess.org>
src/sema/expression.rs Outdated Show resolved Hide resolved
src/sema/expression.rs Outdated Show resolved Hide resolved
src/sema/expression.rs Outdated Show resolved Hide resolved
Signed-off-by: Sean Young <sean@mess.org>
@seanyoung seanyoung force-pushed the szabo-finney branch 2 times, most recently from 46257a6 to f2e3a09 Compare May 12, 2022 08:09
src/sema/expression.rs Outdated Show resolved Hide resolved
src/sema/expression.rs Outdated Show resolved Hide resolved
src/sema/expression.rs Outdated Show resolved Hide resolved
src/sema/yul/expression.rs Outdated Show resolved Hide resolved
src/sema/yul/expression.rs Outdated Show resolved Hide resolved
src/sema/yul/expression.rs Outdated Show resolved Hide resolved
The lexer tries to calculate 10^1111111111111 which will be a very large
number. This will take a long time.

The lexer should not try to calculate numbers from strings, as this
might fail and we do not want the lexer to give up, as no parsing and
semantic analysis will be done.

Signed-off-by: Sean Young <sean@mess.org>
@seanyoung seanyoung merged commit a1bb3c8 into hyperledger:main May 12, 2022
@seanyoung seanyoung deleted the szabo-finney branch May 12, 2022 16:20
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.

uint[1.111111E1111111111111] cause infinite loop in compiler
2 participants