From 990dde5bbf6a6ab539a69d44acb10fe46b3732f8 Mon Sep 17 00:00:00 2001 From: Dmitry Selyutin Date: Sat, 9 Sep 2023 21:16:17 +0300 Subject: [PATCH] libopid: fix nonzero operand --- src/libopid/codegen.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/libopid/codegen.py b/src/libopid/codegen.py index 1d0f11d7..349b2e57 100644 --- a/src/libopid/codegen.py +++ b/src/libopid/codegen.py @@ -279,7 +279,12 @@ class DisGenSource(Source): self.emit("break;") def nonzero_handler(span): - yield from generic_handler(span, "OPID_OPERAND_NONZERO") + yield f"value = (UINT32_C(1) + (" + with self: + yield from fetch(span) + yield f"));" + yield f"flags = OPID_OPERAND_NONZERO;" + self.emit("break;") def signed_handler(span, flags="OPID_OPERAND_SIGNED"): mask = f"(UINT32_C(1) << (UINT32_C({len(span)}) - 1))" -- 2.30.2