Skip to content

Commit b78a154

Browse files
committed
Don't override error codes from bytecode verification
#13444 changes the order of verification for exceptions and bytecodes. This resulted in the error message "thrown object not throwable" for exception verification to be set for bytecode verification failures. This change does not override error codes for bytecode verification which was being done previously. Signed-off-by: Theresa Mammarella <[email protected]>
1 parent 0a3304a commit b78a154

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

runtime/bcverify/rtverify.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ j9rtv_verifyBytecodes (J9BytecodeVerificationData *verifyData)
187187

188188
verifyData->errorModule = J9NLS_BCV_ERR_VERIFY_OUT_OF_MEMORY__MODULE;
189189
verifyData->errorCode = J9NLS_BCV_ERR_VERIFY_OUT_OF_MEMORY__ID;
190-
} else {
190+
} else if (BCV_ERR_NOT_THROWABLE == result) {
191191
verifyData->errorModule = J9NLS_BCV_ERR_NOT_THROWABLE__MODULE;
192192
verifyData->errorCode = J9NLS_BCV_ERR_NOT_THROWABLE__ID;
193193
}
@@ -2504,7 +2504,7 @@ verifyBytecodes (J9BytecodeVerificationData * verifyData)
25042504

25052505
/*
25062506
* returns BCV_SUCCESS on success
2507-
* returns BCV_FAIL on error
2507+
* returns BCV_ERR_NOT_THROWABLE on error
25082508
* returns BCV_ERR_INSUFFICIENT_MEMORY on OOM
25092509
*/
25102510
static IDATA
@@ -2558,7 +2558,7 @@ verifyExceptions (J9BytecodeVerificationData *verifyData)
25582558
(UDATA) J9UTF8_LENGTH(J9ROMMETHOD_SIGNATURE(romMethod)),
25592559
J9UTF8_DATA(J9ROMMETHOD_SIGNATURE(romMethod)),
25602560
i, J9UTF8_LENGTH(catchName), J9UTF8_DATA(catchName));
2561-
rc = BCV_FAIL;
2561+
rc = BCV_ERR_NOT_THROWABLE;
25622562
break;
25632563
}
25642564
}

runtime/oti/j9consts.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -600,6 +600,7 @@ extern "C" {
600600
#define BCV_ERR_BYTECODE_ERROR -34
601601
#define BCV_ERR_NEW_OJBECT_MISMATCH -35
602602
#define BCV_ERR_INIT_FLAGS_MISMATCH -36
603+
#define BCV_ERR_NOT_THROWABLE -37
603604

604605
#define J9_GC_OBJ_HEAP_HOLE 0x1
605606
#define J9_GC_MULTI_SLOT_HOLE 0x1

0 commit comments

Comments
 (0)