From 7b1fa500790f00868af98d602428ebbd4b91973b Mon Sep 17 00:00:00 2001 From: Christian Despres Date: Fri, 22 Nov 2024 22:22:39 -0500 Subject: [PATCH] Ensure addClassFromCPRecord emits CP record The addClassFromCPRecord method of the symbol validation manager should make sure that a ClassFromCPRecord is always added to the current compilation. Signed-off-by: Christian Despres --- .../compiler/runtime/SymbolValidationManager.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/runtime/compiler/runtime/SymbolValidationManager.cpp b/runtime/compiler/runtime/SymbolValidationManager.cpp index 5ccee9b0c5b..3860a2acf35 100644 --- a/runtime/compiler/runtime/SymbolValidationManager.cpp +++ b/runtime/compiler/runtime/SymbolValidationManager.cpp @@ -838,16 +838,17 @@ TR::SymbolValidationManager::addClassFromCPRecord(TR_OpaqueClassBlock *clazz, J9 if (recordExists(&byName)) return true; // already have an equivalent ClassByName - bool added; if (!isAlreadyValidated(clazz)) // save a ClassChainRecord - added = addClassRecordWithChain(new (_region) ClassByNameRecord(clazz, beholder)); - else - added = addClassRecord(clazz, new (_region) ClassFromCPRecord(clazz, beholder, cpIndex)); + { + if (!addClassRecordWithChain(new (_region) ClassByNameRecord(clazz, beholder))) + return false; + } - if (added) - _classesFromAnyCPIndex.insert(ClassFromAnyCPIndex(clazz, beholder)); + if (!addClassRecord(clazz, new (_region) ClassFromCPRecord(clazz, beholder, cpIndex))) + return false; - return added; + _classesFromAnyCPIndex.insert(ClassFromAnyCPIndex(clazz, beholder)); + return true; } bool