* only check validity of assembler instructions in pass_2, after all

local operands have been resolved (mantis #8950)

git-svn-id: trunk@7516 -
This commit is contained in:
Jonas Maebe 2007-05-29 16:53:28 +00:00
parent 2b84a4643a
commit 8bcb6e689d
4 changed files with 32 additions and 6 deletions

1
.gitattributes vendored
View File

@ -8270,6 +8270,7 @@ tests/webtbs/tw8861.pp svneol=native#text/plain
tests/webtbs/tw8870.pp svneol=native#text/plain
tests/webtbs/tw8883.pp svneol=native#text/plain
tests/webtbs/tw8919.pp svneol=native#text/plain
tests/webtbs/tw8950.pp svneol=native#text/plain
tests/webtbs/tw8975.pp svneol=native#text/plain
tests/webtbs/tw8975a.pp svneol=native#text/plain
tests/webtbs/ub1873.pp svneol=native#text/plain

View File

@ -268,8 +268,13 @@ interface
end;
end;
end;
{$ifdef x86}
{ can only be checked now that all local operands }
{ have been resolved }
taicpu(hp2).CheckIfValid;
{$endif x86}
end;
ait_marker :
ait_marker :
begin
{ it's not an assembler block anymore }
if (tai_marker(hp2).kind in [mark_AsmBlockStart, mark_AsmBlockEnd]) then
@ -303,6 +308,11 @@ interface
{ fixup the references }
for i:=1 to taicpu(hp).ops do
ResolveRef(taicpu(hp).oper[i-1]^);
{$ifdef x86}
{ can only be checked now that all local operands }
{ have been resolved }
taicpu(hp).CheckIfValid;
{$endif x86}
end;
end;
hp:=tai(hp.next);

View File

@ -744,11 +744,7 @@ begin
{ Concat the opcode or give an error }
if assigned(ai) then
begin
{ Check the instruction if it's valid }
ai.CheckIfValid;
p.concat(ai);
end
p.concat(ai)
else
Message(asmr_e_invalid_opcode_and_operand);
result:=ai;

19
tests/webtbs/tw8950.pp Normal file
View File

@ -0,0 +1,19 @@
{ %cpu=i386,x86_64 }
{$ifdef fpc}
{$mode delphi}
{$endif}
procedure SetBitBuffer(var Value; const Bit: Cardinal);
asm
BTS [Value], Bit
end;
var
l: longint;
begin
l := 0;
setbitbuffer(l,5);
if (l <> 32) then
halt(1);
end.