mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-15 07:34:33 +00:00
Set FnEnd in JITEmitter::finishFunction to point strictly to the end of function's machine code.
Don't include memory allocated for global variables during relocations resolution. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70517 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
714257f5de
commit
19fee415f6
@ -1051,6 +1051,9 @@ bool JITEmitter::finishFunction(MachineFunction &F) {
|
|||||||
unsigned char *FnStart =
|
unsigned char *FnStart =
|
||||||
(unsigned char *)TheJIT->getPointerToGlobalIfAvailable(F.getFunction());
|
(unsigned char *)TheJIT->getPointerToGlobalIfAvailable(F.getFunction());
|
||||||
|
|
||||||
|
// FnEnd is the end of the function's machine code.
|
||||||
|
unsigned char *FnEnd = CurBufferPtr;
|
||||||
|
|
||||||
if (!Relocations.empty()) {
|
if (!Relocations.empty()) {
|
||||||
CurFn = F.getFunction();
|
CurFn = F.getFunction();
|
||||||
NumRelos += Relocations.size();
|
NumRelos += Relocations.size();
|
||||||
@ -1128,9 +1131,9 @@ bool JITEmitter::finishFunction(MachineFunction &F) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned char *FnEnd = CurBufferPtr;
|
// CurBufferPtr may have moved beyond FnEnd, due to memory allocation for
|
||||||
|
// global variables that were referenced in the relocations.
|
||||||
MemMgr->endFunctionBody(F.getFunction(), BufferBegin, FnEnd);
|
MemMgr->endFunctionBody(F.getFunction(), BufferBegin, CurBufferPtr);
|
||||||
|
|
||||||
if (CurBufferPtr == BufferEnd) {
|
if (CurBufferPtr == BufferEnd) {
|
||||||
// FIXME: Allocate more space, then try again.
|
// FIXME: Allocate more space, then try again.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user