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

Commit 0a6eca2d authored by Christopher Ferris's avatar Christopher Ferris
Browse files

Fix use before set bug in arm32 guest.

I accidentally set the unwind register object using the uninitialized
arm registers. Actually set using the arm registers that contains
valid data.

Test: All unit tests pass.
Test: Ran on an arm32 guest host and verified the guest unwind is valid.
Change-Id: I20a2b6675648df1c627af80aa708071109bdf099
parent 033e4cee
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -546,10 +546,10 @@ static void ReadGuestRegisters(std::unique_ptr<unwindstack::Regs>* regs, pid_t t
#else
    case NATIVE_BRIDGE_ARCH_ARM: {
      unwindstack::arm_user_regs arm_user_regs = {};
      regs->reset(unwindstack::RegsArm::Read(&arm_user_regs));
      for (size_t i = 0; i < unwindstack::ARM_REG_LAST; i++) {
        arm_user_regs.regs[i] = guest_regs.regs_arm.r[i];
      }
      regs->reset(unwindstack::RegsArm::Read(&arm_user_regs));

      g_guest_arch = Architecture::ARM32;
      break;