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
Version: v0.3.3: Atlantis
Description: When assigning a storage variable to a memory variable, accessing the memory variable will cause an error. Specifically, return (m[0][0], m[0][3]); causes an execution error. However, if modified to return (a[0][0], a[0][3]) or return (a_[0][0], a_[0][3]), it does not cause an error. When running the program with solc and EVM, there are no errors.
contractC {
uint72[5][] a;
function f() publicreturns (uint72, uint72) {
for (uint i =0; i <4; i++)
a.push();
a[0][0] =1;
a[0][3] =2;
uint72[5][] storage a_ = a;
uint72[5][] memory m = a_;
return (m[0][0], m[0][3]);
// return (a[0][0], a[0][3]);// return (a_[0][0], a_[0][3]);
}
}
Reproduction: I set up a Solang compilation and execution environment to test the program.
solang/target/debug/vmRunNoPara test.sol C f
The execution error is as follows:
Contract name: C
function new for 4gEZoZtF814TBjE7r5o4qMoDX7QZEJbGN1WMo1ZyzruT
input: 872ccdc6190148bc
running bpf with calldata:872ccdc6190148bc
program: 4gEZoZtF814TBjE7r5o4qMoDX7QZEJbGN1WMo1ZyzruT
static: length:8 0000000000000000
offset:28 prev:10 next:10 length:0 allocated:0
function f for 4gEZoZtF814TBjE7r5o4qMoDX7QZEJbGN1WMo1ZyzruT
input: 352dd00eb9a6751b
running bpf with calldata:352dd00eb9a6751b
program: 4gEZoZtF814TBjE7r5o4qMoDX7QZEJbGN1WMo1ZyzruT
thread 'main' panicked at src/tests/solana.rs:639:13:
assertion `left == right` failed
left: 12884902304
right: 12884902144
stack backtrace:
0: rust_begin_unwind
at /rustc/7608018cbdac9e55d0d13529cf43adc33d53efcf/library/std/src/panicking.rs:665:5
1: core::panicking::panic_fmt
at /rustc/7608018cbdac9e55d0d13529cf43adc33d53efcf/library/core/src/panicking.rs:74:14
2: core::panicking::assert_failed_inner
3: core::panicking::assert_failed
4: solang::tests::solana::SyscallContext::heap_verify
at ./compiler/solang/src/tests/solana.rs:639:13
5: solang::tests::solana::sol_log
at ./compiler/solang/src/tests/solana.rs:679:5
6: solana_rbpf::interpreter::Interpreter<V,C>::step
at /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/solana_rbpf-0.6.1/src/interpreter.rs:453:25
7: solana_rbpf::vm::EbpfVm<C>::execute_program
at /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/solana_rbpf-0.6.1/src/vm.rs:550:19
8: solang::tests::solana::VirtualMachine::execute
at ./compiler/solang/src/tests/solana.rs:1577:24
9: solang::tests::solana::VmFunction::call_with_error_code
at ./compiler/solang/src/tests/solana.rs:1847:19
10: solang::tests::solana::VmFunction::call
at ./compiler/solang/src/tests/solana.rs:1815:15
11: vmRunNoPara::function_call_with_account
at ./compiler/solang/src/bin/vmRunNoPara.rs:205:11
12: vmRunNoPara::main
at ./compiler/solang/src/bin/vmRunNoPara.rs:258:5
13: core::ops::function::FnOnce::call_once
at /root/.rustup/toolchains/nightly-2024-09-30-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:250:5
The text was updated successfully, but these errors were encountered:
Version: v0.3.3: Atlantis
Description: When assigning a storage variable to a memory variable, accessing the memory variable will cause an error. Specifically, return (m[0][0], m[0][3]); causes an execution error. However, if modified to return (a[0][0], a[0][3]) or return (a_[0][0], a_[0][3]), it does not cause an error. When running the program with solc and EVM, there are no errors.
Reproduction: I set up a Solang compilation and execution environment to test the program.
The execution error is as follows:
The text was updated successfully, but these errors were encountered: