mirror of
https://github.com/aljazceru/turso.git
synced 2026-01-05 01:04:22 +01:00
Add `COALESCE` function in fuzz test and fix bug (found by fuzzer with `COALESCE`) related to the resolution of labels which needs to be resolved to next emitted instruction. Before, code assumed that no two labels will need to be resolved to next emitted instruction. But this assumption is wrong (at least in current codegen logic) for example for following expression `COALESCE(0, COALESCE(0, 0))`. Here, both `COALESCE` functions will create label and resolve it to next emitted instruction in the end of generation. So, in this case one of the labels will be actually "orphaned" and never be assigned any position in the emitted code. Closes #955
Integration and regression test suite.
# run all tests
cargo test
# run individual test
cargo test test_sequential_write -- --nocapture