diff options
Diffstat (limited to 'tools/jello/Emitter.cpp')
-rw-r--r-- | tools/jello/Emitter.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/jello/Emitter.cpp b/tools/jello/Emitter.cpp index 89695ad..0e54322 100644 --- a/tools/jello/Emitter.cpp +++ b/tools/jello/Emitter.cpp @@ -68,7 +68,9 @@ void Emitter::emitByte(unsigned char B) { // resolved on demand. Keep track of these markers. // void Emitter::emitPCRelativeDisp(Value *V) { - unsigned ZeroAddr = -(unsigned)CurByte; // Calculate displacement to null + TheVM.addFunctionRef(CurByte, cast<Function>(V)); + + unsigned ZeroAddr = -(unsigned)CurByte-4; // Calculate displacement to null *(unsigned*)CurByte = ZeroAddr; // 4 byte offset CurByte += 4; } |