[llvm-dev] GenericValue of pointer becomes 0 when passed through RunFunction

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[llvm-dev] GenericValue of pointer becomes 0 when passed through RunFunction

Amara Emerson via llvm-dev
I'm trying to pass a function pointer to the LLVM interpreter, but when I print it in the llvm function it is null. I'm using the C API.

Here's the relevant code (It's in D):


and here's the output:

define void @fp_pass_test(void ()*) {
entry:
  %1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @0, i32 0, i32 0), void ()* %0)
  call void %0()
  ret void
}
passed ptr: 4142ddb0
unwrapped ptr: 4142ddb0
received ptr: 0
Program exited with code -11


Does anyone know why the pointer would become null after passing it through LLVMRunFunction?

Best Regards
Hakan

_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev