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

Assembly assignment causes compilation crash #1716

Open
Subway2023 opened this issue Feb 7, 2025 · 0 comments
Open

Assembly assignment causes compilation crash #1716

Subway2023 opened this issue Feb 7, 2025 · 0 comments

Comments

@Subway2023
Copy link

Problem: When using assembly to assign a value that exceeds the range to a variable, it causes a crash.
Version: v0.3.3: Atlantis

test.sol

contract test {
    uint8 x;
    uint v;
    function f() public returns (uint x, uint y, uint z) {
        uint16 a;
        uint32 b;
        assembly {
            a := 0x0f0f0f0f0f
        }
    }
}
solang compile --target solana test.sol

solang: llvm/lib/Support/APInt.cpp:2106: void llvm::APInt::fromString(unsigned int, llvm::StringRef, uint8_t): Assertion `(((slen-1)*64)/22 <= numbits || radix != 10) && "Insufficient bit width"' failed.
Aborted (core dumped)
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