[LLVMdev] Problem invoking win32 api calls

Vijay D techvd at gmail.com
Thu Jan 22 18:43:20 PST 2009


Hi,

I use the kaliedoscope tutorial to do some experiments. I'm trying to define
a few win32 functions as extern and execute them from the toy language.
Functions that take no arguments execute fine (for example, GetLastError()).
However, calling functions that do take arguments (for example,
SetLastError(unsigned int)) always crash the application due to some kind of
stack corruption (Unhandled exception at 0x00000000: 0xC0000005: Access
violation reading location 0x00000000.)

I'm actually using the CallingConv::X86_StdCall calling convention for these
external functions (F->setCallingConv(CallingConv::X86_StdCall);) and that
doesn't resolve the issue.

Any insight is appreciated. Please let me know if you need more details.

Thanks,
Vijay
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090122/58e9de40/attachment.html>


More information about the llvm-dev mailing list