From 44fab2a44d06a956c3121ceba2b39ca7b00dc428 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 29 May 2023 09:39:03 -0300 Subject: Code size stored in code itself Most patterns do not have code, as they are not directly used for a match; they are created only to compose larger patterns. So, we shouldn't waste space to store the size of their code, as a NULL pointer already indicates that the size is zero. --- lpprint.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lpprint.c') diff --git a/lpprint.c b/lpprint.c index 3e7e7f2..54a3da7 100644 --- a/lpprint.c +++ b/lpprint.c @@ -137,8 +137,9 @@ void printinst (const Instruction *op, const Instruction *p) { } -void printpatt (Instruction *p, int n) { +void printpatt (Instruction *p) { Instruction *op = p; + uint n = op[-1].codesize - 1; while (p < op + n) { printinst(op, p); p += sizei(p); -- cgit v1.2.3-55-g6feb