Hello,
I had encountered an unpleasant issue while trying to compile Delphi code that uses inline assembler. The code looks like this:
===
{$asmmode intel}
type
TMyObject = class(TObject)
public
procedure DoSomething;
procedure DoSomethingElse(a, b: Integer);
end;
procedure TMyObject.DoSomething;
begin
SomeStuff;
asm
// here put some values into edx and ecx
mov eax, self
call TMyObject.DoSomethingElse
end;
SomeMoreStuff;
end;
===In Delphi, everything is ok. In FPC, it compiles without errors, but an assembler listing with
'fpc -aMASM -s file.pas' shows that the line 'call TMyObject.DoSomethingElse' is translated into 'call 0' (yes, with literal zero). IMO this shouldn't be so - it must either produce correct address or produce a error during compilation (first case being preferred for Delphi compatibility).
Should I report this as bug?
Best regards,
Sergei
