فهرست منبع

* x86 assembler reader: fixed bug in Tx86Instruction.AddReferenceSizes which was causing "Unable to determine operand size" error on instructions like "cmpss $0x10,(%rax),%xmm7" (3-operand instructions with reference being the source operand).

git-svn-id: trunk@17370 -
sergei 14 سال پیش
والد
کامیت
1bcc41c8c6
1فایلهای تغییر یافته به همراه6 افزوده شده و 4 حذف شده
  1. 6 4
      compiler/x86/rax86.pas

+ 6 - 4
compiler/x86/rax86.pas

@@ -296,11 +296,13 @@ begin
               OPR_LOCAL,
               OPR_REFERENCE :
                 begin
-                  if i=2 then
-                   operand2:=1
+                  { for 3-operand opcodes, operand #1 (in ATT order) is always an immediate,
+                    don't consider it. }
+                  if i=ops then
+                    operand2:=i-1
                   else
-                   operand2:=2;
-                  if operand2<ops then
+                    operand2:=i+1;
+                  if operand2>0 then
                    begin
                      { Only allow register as operand to take the size from }
                      if operands[operand2].opr.typ=OPR_REGISTER then