Skip to content

Commit

Permalink
Only run findVarHandleMethodRefs when _buildResult is OK
Browse files Browse the repository at this point in the history
If we return with a failure from computeConstantPoolMapAndSizes,
we should not call findVarHandleMethodRefs (uses uninitialized data).

Signed-off-by: Bjørn Vårdal <[email protected]>
  • Loading branch information
bjornvar committed Oct 17, 2017
1 parent adf35c9 commit 47eac2e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions runtime/bcutil/ClassFileOracle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,10 +240,12 @@ ClassFileOracle::ClassFileOracle(BufferManager *bufferManager, J9CfrClassFile *c
_constantPoolMap->computeConstantPoolMapAndSizes();
if (!constantPoolMap->isOK()) {
_buildResult = _constantPoolMap->getBuildResult();
}
_constantPoolMap->findVarHandleMethodRefs();
if (!constantPoolMap->isOK()) {
_buildResult = _constantPoolMap->getBuildResult();
} else {
/* computeConstantPoolMapAndSizes must complete successfully before calling findVarHandleMethodRefs */
_constantPoolMap->findVarHandleMethodRefs();
if (!constantPoolMap->isOK()) {
_buildResult = _constantPoolMap->getBuildResult();
}
}
}

Expand Down

0 comments on commit 47eac2e

Please sign in to comment.