summaryrefslogtreecommitdiffstats
path: root/compiler/optimizing/common_arm64.h
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/optimizing/common_arm64.h')
-rw-r--r--compiler/optimizing/common_arm64.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/compiler/optimizing/common_arm64.h b/compiler/optimizing/common_arm64.h
index 007324eb68..9447d3b816 100644
--- a/compiler/optimizing/common_arm64.h
+++ b/compiler/optimizing/common_arm64.h
@@ -118,8 +118,14 @@ static inline vixl::CPURegister InputCPURegisterAt(HInstruction* instr, int inde
static inline int64_t Int64ConstantFrom(Location location) {
HConstant* instr = location.GetConstant();
- return instr->IsIntConstant() ? instr->AsIntConstant()->GetValue()
- : instr->AsLongConstant()->GetValue();
+ if (instr->IsIntConstant()) {
+ return instr->AsIntConstant()->GetValue();
+ } else if (instr->IsNullConstant()) {
+ return 0;
+ } else {
+ DCHECK(instr->IsLongConstant());
+ return instr->AsLongConstant()->GetValue();
+ }
}
static inline vixl::Operand OperandFrom(Location location, Primitive::Type type) {