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

Solang crashes when the code contains specific inline assembly. #1693

Open
lum7na opened this issue Jan 16, 2025 · 0 comments
Open

Solang crashes when the code contains specific inline assembly. #1693

lum7na opened this issue Jan 16, 2025 · 0 comments

Comments

@lum7na
Copy link

lum7na commented Jan 16, 2025

Hello! When I tried to compile the following code using solang, I encountered an error that caused the compiler to crash.

contract Test {
  uint8 constant A = 0;a
  function test(string memory str) public returns(uint8) {

    assembly  {
      for { let b := 0 } lt(b, 0x60) { b := add(b, 0x20) } { continue }
    }
    return A;
  }
}
thread 'main' panicked at src/codegen/dead_storage.rs:370:16:
index out of bounds: the len is 0 but the index is 0
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

I didn't add any special compilation parameters. My compilation command was solang compile a.sol --target solana. The version of solang I used is v0.3.3.

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

No branches or pull requests

1 participant