Răsfoiți Sursa

* fixed pushing of words in intel assembler (indirectly related to
wrong bug report 7808)

git-svn-id: trunk@6274 -

Jonas Maebe 18 ani în urmă
părinte
comite
1a32e4fdf5
3 a modificat fișierele cu 23 adăugiri și 0 ștergeri
  1. 1 0
      .gitattributes
  2. 4 0
      compiler/x86/rax86int.pas
  3. 18 0
      tests/webtbs/tw7808.pp

+ 1 - 0
.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

+ 4 - 0
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;
 
 

+ 18 - 0
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.