Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bytecode: Do not treat perfect type matches as conditional
When matching [write "Hello"] with [write X:text], we don't want to consider the generated code as conditional when it is not. This changes the generated code from: Compiled write "false" as Constants: C0 = "false" C1 = false C2 = true Locals: L0 = [write "false"] L1 = ["false"] Types: write "false" as nil "false" as character Opcodes (2 locals, 0 parameters, 2 temporaries) 0: native #41=xl_write_text, (1) 0: C0 => L0 5: branch +12=19 7: character_typecheck L1, +7=17 10: native #39=xl_write_character, (1) 0: C0 => L0 15: branch +2=19 17: form_error L0 19: ret L0 to: Compiled write "false" as Constants: C0 = "false" C1 = false C2 = true Locals: L0 = [write "false"] Types: write "false" as nil "false" as text Opcodes (1 locals, 0 parameters, 1 temporaries) 0: native #41=xl_write_text, (1) 0: C0 => L0 5: ret L0 Signed-off-by: Christophe de Dinechin <[email protected]>
- Loading branch information