Ver código fonte

Fix: setxx instructions should only accept byte registers

ceriel 29 anos atrás
pai
commit
32f4c842ba
1 arquivos alterados com 5 adições e 1 exclusões
  1. 5 1
      mach/i386/as/mach4.c

+ 5 - 1
mach/i386/as/mach4.c

@@ -129,7 +129,11 @@ oper	:	NOOP_1
 				emit2((int)($2.val));
 			}
 	|	SETCC ea_2
-			{	emit1(0xF); emit1($1|0x90); ea_2(0);}
+			{	if (reg_2 & (IS_R32|IS_RSEG)) {
+					serror("register error");
+				}
+				emit1(0xF); emit1($1|0x90); ea_2(0);
+			}
 	|	XCHG ea_ea
 			{	xchg($1);}
 	|	TEST ea_ea