From 3e473fb23215a50525c498c75b53a1589d2e8643 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerg=C3=B6=20Barany?= Date: Thu, 23 May 2024 14:51:05 +0200 Subject: [PATCH] Don't try to commute address add on null pointer --- .../compiler/core/aarch64/AArch64ArithmeticLIRGenerator.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/core/aarch64/AArch64ArithmeticLIRGenerator.java b/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/core/aarch64/AArch64ArithmeticLIRGenerator.java index 95dc2f91376d..854f8fd5e80e 100644 --- a/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/core/aarch64/AArch64ArithmeticLIRGenerator.java +++ b/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/core/aarch64/AArch64ArithmeticLIRGenerator.java @@ -450,7 +450,8 @@ public static boolean isAddSubtractConstant(JavaConstant constValue) { case Long: return AArch64MacroAssembler.isAddSubtractImmediate(constValue.asLong(), true); case Object: - return constValue.isNull(); + /* Object constants can't be encoded as immediates in add/subtract. */ + return false; default: throw GraalError.shouldNotReachHereUnexpectedValue(constValue.getJavaKind().getStackKind()); // ExcludeFromJacocoGeneratedReport }