Skip to content

Commit

Permalink
Disable initTOC call when disableTOC option is enabled
Browse files Browse the repository at this point in the history
Previously, TR_PPCTableOfConstants::initTOC would be called even if the
disableTOC option was enabled, causing memory to be allocated for the
pTOC even if it was disabled. This call is now guarded by a check of
this option.

Co-authored-by: Julian Wang <zlwang@ca.ibm.com>
Signed-off-by: Ben Thomas <ben@benthomas.ca>
  • Loading branch information
aviansie-ben and zl-wang committed Aug 5, 2020
1 parent 3b66ee9 commit 086094d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion runtime/compiler/p/codegen/Trampoline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ void * ppcPicTrampInit(TR_FrontEnd *vm, TR::PersistentInfo * persistentInfo)

#ifdef TR_TARGET_64BIT
TR_J9VMBase *fej9 = (TR_J9VMBase *)vm;
if (!fej9->isAOT_DEPRECATED_DO_NOT_USE()) // don't init TOC if it is jar2jxe AOT compile
if (!fej9->isAOT_DEPRECATED_DO_NOT_USE() && // don't init TOC if it is jar2jxe AOT compile
!TR::Options::getCmdLineOptions()->getOption(TR_DisableTOC))
{
retVal = TR_PPCTableOfConstants::initTOC(fej9, persistentInfo, 0);
}
Expand Down

0 comments on commit 086094d

Please sign in to comment.