diff options
author | 2017-02-27 00:09:53 +0000 | |
---|---|---|
committer | 2017-02-27 00:09:54 +0000 | |
commit | 2666b11c0d9d7fd22279a7d26338084daf608166 (patch) | |
tree | 30c5f581ee7dd3186a9498f9fdc527aa0c31edc7 /compiler/optimizing/code_generator.cc | |
parent | 5e2227b961980c69361050a4396763937285af9b (diff) | |
parent | 0c95c12a102cb8c1514410be6e264f9730d847a7 (diff) |
Merge "ART: Fix underflow in codegen"
Diffstat (limited to 'compiler/optimizing/code_generator.cc')
-rw-r--r-- | compiler/optimizing/code_generator.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/optimizing/code_generator.cc b/compiler/optimizing/code_generator.cc index 8dd423fcbb..424b8507fb 100644 --- a/compiler/optimizing/code_generator.cc +++ b/compiler/optimizing/code_generator.cc @@ -861,8 +861,11 @@ void CodeGenerator::RecordPcInfo(HInstruction* instruction, bool CodeGenerator::HasStackMapAtCurrentPc() { uint32_t pc = GetAssembler()->CodeSize(); size_t count = stack_map_stream_.GetNumberOfStackMaps(); + if (count == 0) { + return false; + } CodeOffset native_pc_offset = stack_map_stream_.GetStackMap(count - 1).native_pc_code_offset; - return (count > 0) && (native_pc_offset.Uint32Value(GetInstructionSet()) == pc); + return (native_pc_offset.Uint32Value(GetInstructionSet()) == pc); } void CodeGenerator::MaybeRecordNativeDebugInfo(HInstruction* instruction, |