* don't parse "flags" as a register name in the Intel assembler reader

(mantis #29040)

git-svn-id: trunk@32368 -
This commit is contained in:
Jonas Maebe 2015-11-19 19:40:06 +00:00
parent 8e9256a93c
commit fd0c2f36e5
3 changed files with 41 additions and 0 deletions

1
.gitattributes vendored
View File

@ -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

View File

@ -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
tests/webtbs/tw29040.pp Normal file
View File

@ -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.