Skip to content

Commit 412d5a4

Browse files
author
Mike Pall
committed
DynASM/x86: Fix VREG support.
1 parent 90e6551 commit 412d5a4

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

dynasm/dasm_x86.h

+7-4
Original file line numberDiff line numberDiff line change
@@ -299,11 +299,13 @@ int dasm_link(Dst_DECL, size_t *szp)
299299

300300
while (pos != lastpos) {
301301
dasm_ActList p = D->actionlist + b[pos++];
302+
int op = 0;
302303
while (1) {
303-
int op, action = *p++;
304+
int action = *p++;
304305
switch (action) {
305-
case DASM_REL_LG: p++; op = p[-3]; goto rel_pc;
306-
case DASM_REL_PC: op = p[-2]; rel_pc: {
306+
case DASM_REL_LG: p++;
307+
/* fallthrough */
308+
case DASM_REL_PC: {
307309
int shrink = op == 0xe9 ? 3 : ((op&0xf0) == 0x80 ? 4 : 0);
308310
if (shrink) { /* Shrinkable branch opcode? */
309311
int lofs, lpos = b[pos];
@@ -335,9 +337,10 @@ int dasm_link(Dst_DECL, size_t *szp)
335337
case DASM_LABEL_PC: b[pos++] += ofs; break; /* Fix label offset. */
336338
case DASM_ALIGN: ofs -= (b[pos++]+ofs)&*p++; break; /* Adjust ofs. */
337339
case DASM_EXTERN: p += 2; break;
338-
case DASM_ESC: p++; break;
340+
case DASM_ESC: op = *p++; break;
339341
case DASM_MARK: break;
340342
case DASM_SECTION: case DASM_STOP: goto stop;
343+
default: op = action; break;
341344
}
342345
}
343346
stop: (void)0;

0 commit comments

Comments
 (0)