anza-xyz / move

Move compiler targeting llvm supported backends
https://discord.gg/wFgfjG9J
Apache License 2.0
107 stars 32 forks source link

[Bug] Implement runtime recursion limit #367

Open brson opened 10 months ago

brson commented 10 months ago

Followup to https://github.com/solana-labs/move/issues/333

The move VM produces errors in some cases when asked to recurse deeply. move-native has no limits and will just crash if it hits the end of the stack.

The only case of this I have seen is in this test case in stdlib's bcs_tests:

    #[test]
    #[expected_failure] // VM_MAX_VALUE_DEPTH_REACHED
    fun encode_129() {
        bcs::to_bytes(&Box { x: box127(true) });
    }

But there are probably others.