2
0
Эх сурвалжийг харах

* don't parse "flags" as a register name in the Intel assembler reader
(mantis #29040)

git-svn-id: trunk@32368 -

Jonas Maebe 9 жил өмнө
parent
commit
fd0c2f36e5

+ 1 - 0
.gitattributes

@@ -14841,6 +14841,7 @@ tests/webtbs/tw28934.pp svneol=native#text/plain
 tests/webtbs/tw2897.pp svneol=native#text/plain
 tests/webtbs/tw2899.pp svneol=native#text/plain
 tests/webtbs/tw2904.pp svneol=native#text/plain
+tests/webtbs/tw29040.pp svneol=native#text/plain
 tests/webtbs/tw2908.pp svneol=native#text/plain
 tests/webtbs/tw2911.pp svneol=native#text/plain
 tests/webtbs/tw2912.pp svneol=native#text/plain

+ 3 - 0
compiler/x86/rax86int.pas

@@ -228,6 +228,9 @@ Unit Rax86int;
       begin
         is_register:=false;
         actasmregister:=masm_regnum_search(lower(s));
+        { don't acceps "flags" as register name in an instruction }
+        if actasmregister=NR_FLAGS then
+          actasmregister:=NR_NO;
         if (actasmregister=NR_NO) and
            (current_procinfo.procdef.proccalloption=pocall_register) and
            (po_assembler in current_procinfo.procdef.procoptions) then

+ 37 - 0
tests/webtbs/tw29040.pp

@@ -0,0 +1,37 @@
+{ %cpu=i386 }
+{ %norun }
+
+program asm_test004;
+{$APPTYPE CONSOLE}
+{$OPTIMIZATION SIZE}
+{$OPTIMIZATION STACKFRAME}
+{$OPTIMIZATION REGVAR}
+{$CODEALIGN VARMIN=1}
+{$CODEALIGN VARMAX=1}
+{$CODEALIGN CONSTMIN=1}
+{$CODEALIGN CONSTMAX=1}
+{$mode delphi}
+{$asmmode intel}
+
+
+
+const
+wmoven = 1;
+            //  eax edx ecx  stack
+procedure test1(a , b , c,   flags :longint); register; //__ pbby in ver 3.0.0 the "flags" is reserved word _   with ver 2.6.4 no compilation error
+var
+f       :boolean;
+asm
+   mov a,0
+   mov b,0
+   mov c,0
+   test [flags] , wmoven
+   setnz f
+end;
+
+var
+i       :cardinal;
+
+begin
+ test1(i,i,i,i);
+end.