Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c19dc358 authored by Florian Mayer's avatar Florian Mayer Committed by android-build-merger
Browse files

Merge "Fix off by one error." am: 551efd11 am: efc71fde

am: c5bcb5df

Change-Id: I3d72e86b6bcb79d5d6156664b489229b5b853900
parents b3e54646 c5bcb5df
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -41,7 +41,7 @@ struct RegsInfo {
  }

  inline AddressType* Save(uint32_t reg) {
    if (reg > MAX_REGISTERS) {
    if (reg >= MAX_REGISTERS) {
      // This should never happen since all currently supported
      // architectures have < 64 total registers.
      abort();
+7 −0
Original line number Diff line number Diff line
@@ -82,4 +82,11 @@ TEST(RegsInfoTest, all) {
  }
}

TEST(RegsInfoTest, invalid_register) {
  RegsImplFake<uint64_t> regs(64);
  RegsInfo<uint64_t> info(&regs);

  EXPECT_DEATH(info.Save(RegsInfo<uint64_t>::MAX_REGISTERS), "");
}

}  // namespace unwindstack