[LLVMdev] Typo in IsLegalToCallImmediateAddr?

Rafael Espíndola rafael.espindola at gmail.com
Thu Oct 20 16:02:04 PDT 2011


2011/10/17 David Meyer <pdox at google.com>:
> Rafael,
>
> I believe your example is not related to IsLegalToCallImmediateAddr.
>
> This is an example of calling to an immediate address:
>
> typedef int (*funcptr)(void);
>
> int main() {
>  funcptr foo = (funcptr)0x100;
>  foo();
> }
>
> If IsLegalToCallImmedateAddr is true, this generates a call to
> absolute address 0x100:
>
> call 0x100
>

If so there is a bug, but I cannot reproduce it. I am getting:

   0:	b8 00 01 00 00       	mov    $0x100,%eax
   5:	ff e0                	jmp    *%eax

I have tried 142624.

> - pdox
>

Cheers,
Rafael




More information about the llvm-dev mailing list