Open dmakarov opened 1 year ago
A smaller module also crashes
module main::struct_nested {
struct Box<T> has copy, drop, store { a: T }
struct Box3<T> has copy, drop, store { b: Box<Box<T>> }
fun box3<T>(x: T): Box3<T> {
Box3 { b: Box { a: Box { a: x } } }
}
public entry fun bar() {
let x = box3(true);
assert!(x.b.a.a, 0);
}
}
[DEBUG language/solana/move-to-solana/src/stackless/module_context.rs:454] Declare Move function struct_nested__bar
[DEBUG language/solana/move-to-solana/src/stackless/module_context.rs:454] Declare Move function struct_nested__box3_bool
[DEBUG language/solana/move-to-solana/src/stackless/module_context.rs:645] instance struct_nested::Box3<bool>
[DEBUG language/solana/move-to-solana/src/stackless/module_context.rs:645] instance struct_nested::Box3
[DEBUG language/solana/move-to-solana/src/stackless/module_context.rs:645] instance struct_nested::Box3
[DEBUG language/solana/move-to-solana/src/stackless/module_context.rs:645] instance struct_nested::Box<bool>
[DEBUG language/solana/move-to-solana/src/stackless/module_context.rs:645] instance struct_nested::Box<bool>
[DEBUG language/solana/move-to-solana/src/stackless/module_context.rs:645] instance struct_nested::Box3<bool>
Segmentation fault (core dumped)
A smaller module also crashes
module main::struct_nested { struct Box<T> has copy, drop, store { a: T } struct Box3<T> has copy, drop, store { b: Box<Box<T>> } fun box3<T>(x: T): Box3<T> { Box3 { b: Box { a: Box { a: x } } } } public entry fun bar() { let x = box3(true); assert!(x.b.a.a, 0); } }
[DEBUG language/solana/move-to-solana/src/stackless/module_context.rs:454] Declare Move function struct_nested__bar [DEBUG language/solana/move-to-solana/src/stackless/module_context.rs:454] Declare Move function struct_nested__box3_bool [DEBUG language/solana/move-to-solana/src/stackless/module_context.rs:645] instance struct_nested::Box3<bool> [DEBUG language/solana/move-to-solana/src/stackless/module_context.rs:645] instance struct_nested::Box3 [DEBUG language/solana/move-to-solana/src/stackless/module_context.rs:645] instance struct_nested::Box3 [DEBUG language/solana/move-to-solana/src/stackless/module_context.rs:645] instance struct_nested::Box<bool> [DEBUG language/solana/move-to-solana/src/stackless/module_context.rs:645] instance struct_nested::Box<bool> [DEBUG language/solana/move-to-solana/src/stackless/module_context.rs:645] instance struct_nested::Box3<bool> Segmentation fault (core dumped)
This error was triggered by compiling entry function returning no value. Fixed by #319
🐛 Bug
To reproduce
Where struct-nested contain the following module
Code snippet to reproduce
Stack trace/error message