TritonVM / tasm-lang

Writing tasm with Rust syntax
15 stars 2 forks source link

Return error if VM execution fails, don't panic #21

Closed Sword-Smith closed 9 months ago

Sword-Smith commented 1 year ago

The test framework should return an error instead of panicking if the VM execution of a program fails. The reason for this is that it is easier to test returned errors than a panicked execution. So when we e.g. make a test to verify that a u64 multiplication with overflow crashes the VM, we want to be sure why execution was stopped. For this, errors are better than panics.

Sword-Smith commented 9 months ago

You can use execute_with_stack_safe_lists for this