[LLVMdev] [BUG x2] getPointerToGlobal is broken

Ramkumar Ramachandra artagnon at gmail.com
Sun Dec 21 17:45:25 PST 2014


Never mind; I'm just rediscovering bugs, it seems. From
unittests/ExecutionEngine/MCJIT/MCJITTest.cpp:

// FIXME: This case fails due to a bug with getPointerToGlobal().
// The bug is due to MCJIT not having an implementation of getPointerToGlobal()
// which results in falling back on the ExecutionEngine implementation that
// allocates a new memory block for the global instead of using the same
// global variable that is emitted by MCJIT. Hence, the pointer (gvPtr below)
// has the correct initial value, but updates to the real global (accessed by
// JITted code) are not propagated. Instead, getPointerToGlobal() should return
// a pointer into the loaded ObjectImage to reference the emitted global.

The OCaml bindings need to chuck gptg and replace it with a wrapper to
a more suitable function.



More information about the llvm-dev mailing list