You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An error occurs when assigning a uint8 type (which is actually uint256) to a bytes32 type in Yul assembly, causing the assert for type length to fail.
Compile: solang compile a.sol --target solana
Code:
contractTest {
function test() externalreturns(bytes32result) {
uint8 st =127;
assembly { result := st }
}
}
Output:
warning: function can be declared 'pure'
┌─ ~/xxx/a.sol:2:3
│
2 │ function test() external returns(bytes32 result) {
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
thread 'main' panicked at src/emit/expression.rs:2212:13:
assertion `left == right` failed
left: 1
right: 32
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Version: solang version v0.3.3-56-g08dbe495
The text was updated successfully, but these errors were encountered:
An error occurs when assigning a
uint8
type (which is actuallyuint256
) to abytes32
type in Yul assembly, causing theassert
for type length to fail.Compile:
solang compile a.sol --target solana
Code:
Output:
Version:
solang version v0.3.3-56-g08dbe495
The text was updated successfully, but these errors were encountered: