]> Shamusworld >> Repos - rmac/commitdiff
Properly advance past register bank specifier
authorJames Jones <atari@theinnocuous.com>
Sun, 12 Apr 2020 05:25:48 +0000 (22:25 -0700)
committerShamus Hammons <jlhamm@acm.org>
Fri, 8 May 2020 15:21:47 +0000 (10:21 -0500)
Register banks, like all constants, are stored
in the token stream as uint64_t values.  Hence,
to advance the stream, the 32-bit tok pointer
must be advanced twice after parsing a register
bank.

procln.c

index be57b7d7f366f53db548a34a7b16bf4d450711d5..8cdcc6af2501cd5e8b1886cbe76e3813a63a46d9 100644 (file)
--- a/procln.c
+++ b/procln.c
@@ -486,6 +486,11 @@ When checking to see if it's already been equated, issue a warning.
                                                registerbank = BANK_0;
                                        else if (*(uint64_t *)tok == 1)
                                                registerbank = BANK_1;
+
+                                       // Advance half-way through the 64-bit const.
+                                       // The code below, expecting a regular token,
+                                       // will advance past the second half.
+                                       tok++;
                                }
 
 #ifdef DEBODGE_REGBANK