From d02e5d542527163231defd7b8d969d1265ca155a Mon Sep 17 00:00:00 2001 From: Alice Frosi Date: Mon, 5 Jun 2023 14:09:17 +0200 Subject: seitan: operations Added: - fix offset for jumping to the next block (use absolute jump and not relative. - fix op_cmp, jump if the comparison is true. - added a couple of debug print --- operations.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'operations.h') diff --git a/operations.h b/operations.h index e9204d3..f543d7a 100644 --- a/operations.h +++ b/operations.h @@ -14,16 +14,17 @@ #include "common/util.h" #define STACK_SIZE (1024 * 1024 / 8) -#define HANDLE_OP(code, call, type) \ +#define HANDLE_OP(code, call, type, g) \ case code: \ do { \ + struct op *start = (struct op *)g->inst; \ int res = call(req, notifier, g, &op->op.type); \ if (res == 0) \ (op)++; \ else if (res == -1) \ return -1; \ else \ - (op) += res; \ + (op) = start + res; \ } while (0); \ break -- cgit v1.2.3