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

pratt parser panics on invalid input #562

Closed
OmarTawfik opened this issue Aug 3, 2023 · 1 comment · Fixed by #564
Closed

pratt parser panics on invalid input #562

OmarTawfik opened this issue Aug 3, 2023 · 1 comment · Fixed by #564
Assignees

Comments

@OmarTawfik
Copy link
Collaborator

Copied from 0xalpharush/slang-fuzz#1

contract test {

	function intMinA() public pure returns (bool) {

		int8 int8_min = type(int8).min;
		require(int8_min == -2*;
  0   n == -2**127);

		return true;
	}

	function intMinC() public pure returreturn trb3
thread '<unnamed>' panicked at 'removal index (is 2) should be < len (is 2)', /Users/alpharush/.cargo/git/checkouts/slang-30d565f6b9959ce1/c542db9/crates/solidity/outputs/cargo/crate/src/legacy/generated/parser_helpers.rs:277:37
@0xalpharush
Copy link

Similar but distinct crash

contract test {
    function run(uint x1, uint x2, uint x3) public returns(uint y) {
        uint8 a = 0x1; uint8 b = 0x10; uint16 c = 0x100;
        y = a + b/+ c + x1 + x2 + x3;
        y += b + x2;
    }
}
// ----
// run(uint256,uint256,uint256): 0x1000, 0x10000, 0x100000 -> 0x121121

thread '<unnamed>' panicked at 'removal index (is 4) should be < len (is 4)', /Users/alpharush/.cargo/git/checkouts/slang-30d565f6b9959ce1/c542db9/crates/solidity/outputs/cargo/crate/src/legacy/generated/parser_helpers.rs:277:37

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: No status
Development

Successfully merging a pull request may close this issue.

3 participants