diff --git a/compiler/runtime/OMRCodeCache.cpp b/compiler/runtime/OMRCodeCache.cpp index 3ef44f73b..0164020a2 100644 --- a/compiler/runtime/OMRCodeCache.cpp +++ b/compiler/runtime/OMRCodeCache.cpp @@ -682,7 +682,15 @@ OMR::CodeCache::syncTempTrampolines() { void *newPC = (void *) TR::Compiler->mtd.startPC(entry->_info._resolved._method); void *trampoline = entry->_info._resolved._currentTrampoline; - if (trampoline && entry->_info._resolved._currentStartPC != newPC) + bool forceCreateTrampoline = false; + + if (reinterpret_cast(newPC) == 0) + { + newPC = entry->_info._resolved._currentStartPC; + forceCreateTrampoline = true; + } + + if (trampoline && (forceCreateTrampoline || (entry->_info._resolved._currentStartPC != newPC))) { self()->createTrampoline(trampoline, newPC, @@ -710,6 +718,11 @@ OMR::CodeCache::syncTempTrampolines() CodeCacheHashEntry *entry = syncBlock->_hashEntryArray[entryIdx]; void *newPC = (void *) TR::Compiler->mtd.startPC(entry->_info._resolved._method); + if (reinterpret_cast(newPC) == 0) + { + newPC = entry->_info._resolved._currentStartPC; + } + // call the codegen to perform the trampoline code modification self()->createTrampoline(entry->_info._resolved._currentTrampoline, newPC,