diff options
author | Jo-Philipp Wich <jo@mein.io> | 2021-03-11 10:13:48 +0100 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2021-03-11 11:33:21 +0100 |
commit | ab8090d39f3c9c750b093621813292bd5bf7c372 (patch) | |
tree | 840924bae197d8656dfa7cc3f470a0ed4a80da4b /vm.h | |
parent | 29a5ab1d6e0f3d54de629e10376435e53c6a3121 (diff) |
compiler: fix switch case->default fallthrough
Simplify handling of default case in switch statements. Instead of jumping
over the default block, simply record the start address of the block since
the initial switch jump is patched into the first non-default case already.
This also leads to slightly smaller bytecode.
Previously, when a case branch fell through into a default block, it did
hit the default skip jump which jumped back into the first case which then
fell through into the default skip jump, leading to an endless loop.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'vm.h')
0 files changed, 0 insertions, 0 deletions