Skip to content

Commit

Permalink
[GR-54185] Don't try to commute address add on null pointer
Browse files Browse the repository at this point in the history
PullRequest: graal/17858
  • Loading branch information
gergo- committed May 30, 2024
2 parents 21ded9e + 3e473fb commit 07e8a71
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 07e8a71

Please sign in to comment.