From 87d562145c925a47f76bc759795930379677ad17 Mon Sep 17 00:00:00 2001 From: Luke Li Date: Tue, 10 Sep 2024 15:14:30 -0400 Subject: [PATCH] TR_RelocationRecordClassAddress Relocates Correctly with Ordered Pair The ordered pair variant of `TR_RelocationRecordClassAddress::applyRelocation` now correctly gets its old constant pool pointer for generating the new constant pool pointer. Signed-off-by: Luke Li --- runtime/compiler/runtime/RelocationRecord.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/runtime/compiler/runtime/RelocationRecord.cpp b/runtime/compiler/runtime/RelocationRecord.cpp index b846cd17fb1..bb075e89f16 100644 --- a/runtime/compiler/runtime/RelocationRecord.cpp +++ b/runtime/compiler/runtime/RelocationRecord.cpp @@ -2171,8 +2171,6 @@ TR_RelocationRecordClassAddress::computeNewClassAddress(TR_RelocationRuntime *re TR_RelocationErrorCode TR_RelocationRecordClassAddress::applyRelocation(TR_RelocationRuntime *reloRuntime, TR_RelocationTarget *reloTarget, uint8_t *reloLocation) { - uintptr_t oldAddress = (uintptr_t) reloTarget->loadAddress(reloLocation); - uintptr_t newConstantPool = computeNewConstantPool(reloRuntime, reloTarget, constantPool(reloTarget)); TR_OpaqueClassBlock *newAddress = computeNewClassAddress(reloRuntime, newConstantPool, inlinedSiteIndex(reloTarget), cpIndex(reloTarget)); @@ -2185,8 +2183,7 @@ TR_RelocationRecordClassAddress::applyRelocation(TR_RelocationRuntime *reloRunti TR_RelocationErrorCode TR_RelocationRecordClassAddress::applyRelocation(TR_RelocationRuntime *reloRuntime, TR_RelocationTarget *reloTarget, uint8_t *reloLocationHigh, uint8_t *reloLocationLow) { - uintptr_t oldValue = (uintptr_t) reloTarget->loadAddress(reloLocationHigh, reloLocationLow); - uintptr_t newConstantPool = computeNewConstantPool(reloRuntime, reloTarget, oldValue); + uintptr_t newConstantPool = computeNewConstantPool(reloRuntime, reloTarget, constantPool(reloTarget)); TR_OpaqueClassBlock *newAddress = computeNewClassAddress(reloRuntime, newConstantPool, inlinedSiteIndex(reloTarget), cpIndex(reloTarget)); if (!newAddress) return TR_RelocationErrorCode::classValidationFailure;