Skip to content

Commit

Permalink
Merge pull request #14936 from pshipton/excptcheck0.32
Browse files Browse the repository at this point in the history
(0.32) Add the exception check for initializeClassIfNeeded()
  • Loading branch information
keithc-ca committed Apr 19, 2022
2 parents d7362b6 + b08c268 commit 9a84ec3
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion runtime/vm/MHInterpreter.inc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2001, 2021 IBM Corp. and others
* Copyright (c) 2001, 2022 IBM Corp. and others
*
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -143,6 +143,9 @@ VM_MHInterpreter::dispatchLoop(j9object_t methodHandle)
}
case J9_METHOD_HANDLE_KIND_STATIC: {
methodHandle = initializeClassIfNeeded(methodHandle);
if (VM_VMHelpers::exceptionPending(_currentThread)) {
goto throwCurrentException;
}
/* fall through */
}
case J9_METHOD_HANDLE_KIND_SPECIAL: {
Expand Down Expand Up @@ -379,6 +382,9 @@ VM_MHInterpreter::dispatchLoop(j9object_t methodHandle)
}
case J9_METHOD_HANDLE_KIND_CONSTRUCTOR: {
methodHandle = initializeClassIfNeeded(methodHandle);
if (VM_VMHelpers::exceptionPending(_currentThread)) {
goto throwCurrentException;
}
j9object_t type = getMethodHandleMethodType(methodHandle);
U_32 slotCount = getMethodTypeArgSlots(type);
J9Class *allocateClass = J9VM_J9CLASS_FROM_HEAPCLASS(
Expand Down Expand Up @@ -473,6 +479,9 @@ VM_MHInterpreter::dispatchLoop(j9object_t methodHandle)
}
case J9_METHOD_HANDLE_KIND_GET_STATIC_FIELD: {
methodHandle = initializeClassIfNeeded(methodHandle);
if (VM_VMHelpers::exceptionPending(_currentThread)) {
goto throwCurrentException;
}
J9Class* defc = getPrimitiveHandleDefc(methodHandle);
UDATA srcAddress = getVMSlot(methodHandle);
srcAddress &= ~J9_SUN_FIELD_OFFSET_MASK;
Expand Down Expand Up @@ -500,6 +509,9 @@ VM_MHInterpreter::dispatchLoop(j9object_t methodHandle)
}
case J9_METHOD_HANDLE_KIND_PUT_STATIC_FIELD: {
methodHandle = initializeClassIfNeeded(methodHandle);
if (VM_VMHelpers::exceptionPending(_currentThread)) {
goto throwCurrentException;
}
j9object_t type = getMethodHandleMethodType(methodHandle);
J9Class* defc = getPrimitiveHandleDefc(methodHandle);
UDATA srcAddress = getVMSlot(methodHandle);
Expand Down

0 comments on commit 9a84ec3

Please sign in to comment.