comparison lwasm/os9.c @ 560:dba08c7dff96

Fix off by one handling MOD directive optional arguments Fixes an off by one in handling the optional arguments to the MOD directive as of changeset 928c033c0cd0. Thanks to Alex Evans <varmfskii@gmail.com> for reporting the problem and a suggested fix. This fix is different but should be more stable should the rest of the parsing code be refactored in the future.
author William Astle <lost@l-w.ca>
date Fri, 22 Sep 2023 12:15:09 -0600
parents 928c033c0cd0
children
comparison
equal deleted inserted replaced
559:ddc7b05a5675 560:dba08c7dff96
130 l -> daddr = lw_expr_build(lw_expr_type_int, 0); 130 l -> daddr = lw_expr_build(lw_expr_type_int, 0);
131 131
132 // init crc 132 // init crc
133 as -> inmod = 1; 133 as -> inmod = 1;
134 134
135 l -> len = (i == 6) ? 13 : 9; 135 l -> len = (l -> lint == 6) ? 13 : 9;
136 } 136 }
137 137
138 EMITFUNC(pseudo_emit_mod) 138 EMITFUNC(pseudo_emit_mod)
139 { 139 {
140 lw_expr_t e1, e2, e3, e4; 140 lw_expr_t e1, e2, e3, e4;