* allow call dword ptr eax in delphi, resolves #18225

git-svn-id: trunk@35572 -
This commit is contained in:
florian 2017-03-12 16:37:48 +00:00
parent 5de5fa9b7b
commit ad557a1da6
4 changed files with 26 additions and 1 deletions

2
.gitattributes vendored
View File

@ -13706,6 +13706,7 @@ tests/webtbf/tw18058b.pp svneol=native#text/plain
tests/webtbf/tw18058c.pp svneol=native#text/plain
tests/webtbf/tw18096.pp svneol=native#text/pascal
tests/webtbf/tw18096c.pp svneol=native#text/pascal
tests/webtbf/tw18225b.pp svneol=native#text/pascal
tests/webtbf/tw18267.pp svneol=native#text/plain
tests/webtbf/tw1827.pp svneol=native#text/plain
tests/webtbf/tw1830.pp svneol=native#text/plain
@ -14619,6 +14620,7 @@ tests/webtbs/tw18127.pp svneol=native#text/pascal
tests/webtbs/tw18131.pp svneol=native#text/pascal
tests/webtbs/tw1820.pp svneol=native#text/plain
tests/webtbs/tw18222.pp svneol=native#text/pascal
tests/webtbs/tw18225.pp svneol=native#text/pascal
tests/webtbs/tw1825.pp svneol=native#text/plain
tests/webtbs/tw18266.pp svneol=native#text/plain
tests/webtbs/tw18334.pp svneol=native#text/plain

View File

@ -1842,7 +1842,10 @@ Unit Rax86int;
Message(asmr_e_syn_operand);
end;
Consume(AS_PTR);
oper.InitRef;
{ in delphi mode, allow e.g. call dword ptr eax,
see also webtbs/tw18225.pp }
if not(m_delphi in current_settings.modeswitches) then
oper.InitRef;
{ if the operand subscripts a record, the typesize will be
rest -> save it here and restore it afterwards }
l:=oper.typesize;

10
tests/webtbf/tw18225b.pp Normal file
View File

@ -0,0 +1,10 @@
{ %fail }
{ %cpu=i386,x86_64 }
{$asmmode intel}
procedure CallProc(p: pointer); assembler;
asm
call dword ptr p
call dword ptr CallProc
end; { CallProc }
begin
end.

10
tests/webtbs/tw18225.pp Normal file
View File

@ -0,0 +1,10 @@
{ %cpu=i386,x86_64 }
{$mode delphi}
{$asmmode intel}
procedure CallProc(p: pointer); assembler;
asm
call dword ptr p
call dword ptr CallProc
end; { CallProc }
begin
end.