From 8d1240fea7e0d2c75663f71f825a5fb3a087d3f6 Mon Sep 17 00:00:00 2001 From: Jose Rodriguez Date: Sun, 19 Jul 2026 23:48:07 +0200 Subject: [PATCH] fix: bug in type conversion --- src/arch/z80/backend/generic.py | 2 +- tests/functional/arch/zx48k/bool_crash.asm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/arch/z80/backend/generic.py b/src/arch/z80/backend/generic.py index 630db6514..08bb9286e 100644 --- a/src/arch/z80/backend/generic.py +++ b/src/arch/z80/backend/generic.py @@ -345,7 +345,7 @@ def _cast(ins: Quad): xsB = sB = YY_TYPES[tB] # Type sizes if tA in ("u8", "i8") and tB == "bool": - return [] # bytes are booleans already (0 = False, not 0 = True) + return [*Bits8.get_oper(ins[4]), "push af"] # bytes are booleans already (0 = False, not 0 = True) output = [] if tA in ("u8", "i8", "bool"): diff --git a/tests/functional/arch/zx48k/bool_crash.asm b/tests/functional/arch/zx48k/bool_crash.asm index 342deb639..0c3f73144 100644 --- a/tests/functional/arch/zx48k/bool_crash.asm +++ b/tests/functional/arch/zx48k/bool_crash.asm @@ -38,7 +38,7 @@ _ReadKeys: push ix ld ix, 0 add ix, sp - pop af + ld a, (_pldx) ld hl, (_pldx - 1) or h jp z, .LABEL.__LABEL1