From 1a32e4fdf5939fc3a1b3b77e2bf963dae46e29b2 Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Tue, 30 Jan 2007 21:52:11 +0000 Subject: [PATCH] * fixed pushing of words in intel assembler (indirectly related to wrong bug report 7808) git-svn-id: trunk@6274 - --- .gitattributes | 1 + compiler/x86/rax86int.pas | 4 ++++ tests/webtbs/tw7808.pp | 18 ++++++++++++++++++ 3 files changed, 23 insertions(+) create mode 100644 tests/webtbs/tw7808.pp diff --git a/.gitattributes b/.gitattributes index aa6ca4e2db..9a74b19a19 100644 --- a/.gitattributes +++ b/.gitattributes @@ -7980,6 +7980,7 @@ tests/webtbs/tw7719.pp svneol=native#text/plain tests/webtbs/tw7756.pp svneol=native#text/plain tests/webtbs/tw7803.pp svneol=native#text/plain tests/webtbs/tw7806.pp svneol=native#text/plain +tests/webtbs/tw7808.pp svneol=native#text/plain tests/webtbs/tw7817a.pp svneol=native#text/plain tests/webtbs/tw7817b.pp svneol=native#text/plain tests/webtbs/tw7847.pp svneol=native#text/plain diff --git a/compiler/x86/rax86int.pas b/compiler/x86/rax86int.pas index 26da005f7e..816af14b62 100644 --- a/compiler/x86/rax86int.pas +++ b/compiler/x86/rax86int.pas @@ -1972,6 +1972,10 @@ Unit Rax86int; if instr.operands[i].opr.typ=OPR_NONE then Message(asmr_e_syntax_error); end; + { e.g. for "push dword 1", "push word 6" } + if (instr.ops=1) and + (instr.operands[1].typesize<>0) then + instr.operands[1].setsize(instr.operands[1].typesize,false); end; diff --git a/tests/webtbs/tw7808.pp b/tests/webtbs/tw7808.pp new file mode 100644 index 0000000000..346ea167cf --- /dev/null +++ b/tests/webtbs/tw7808.pp @@ -0,0 +1,18 @@ +{ %cpu=i386 } +{ %opt=-Sew } + +{$mode delphi} + +procedure test(l: longint); stdcall; +begin + if l<>longint($deadbeef) then + halt(1); +end; + +begin + asm + push word $dead + push word $beef + call test + end; +end.