From a54d579fc608301d6f7634dfc3d5ec7bc32c8181 Mon Sep 17 00:00:00 2001 From: Yi Zhang Date: Mon, 30 Mar 2020 19:34:21 -0700 Subject: [PATCH] fix withfield with null --- runtime/compiler/ilgen/Walker.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/runtime/compiler/ilgen/Walker.cpp b/runtime/compiler/ilgen/Walker.cpp index 5418e22bc9a..252f77d2740 100644 --- a/runtime/compiler/ilgen/Walker.cpp +++ b/runtime/compiler/ilgen/Walker.cpp @@ -6095,6 +6095,9 @@ TR_J9ByteCodeIlGenerator::genWithField(uint16_t fieldCpIndex) TR::Node *newFieldValue = pop(); TR::Node *originalObject = pop(); + TR::Node *passThruNode = TR::Node::create(TR::PassThrough, 1, originalObject); + genTreeTop(genNullCheck(passThruNode)); + loadClassObject(valueClass); const TR::TypeLayout *typeLayout = comp()->typeLayout(valueClass); size_t fieldCount = typeLayout->count();