diff --git a/src/processor/cfi_frame_info.cc b/src/processor/cfi_frame_info.cc index 280620f2..258a1194 100644 --- a/src/processor/cfi_frame_info.cc +++ b/src/processor/cfi_frame_info.cc @@ -81,7 +81,7 @@ bool CFIFrameInfo::FindCallerRegs(const RegisterValueMap& registers, working = registers; working[".cfa"] = cfa; if (!evaluator.EvaluateForValue(it->second, &value)) - return false; + continue; (*caller_registers)[it->first] = value; } diff --git a/src/processor/cfi_frame_info_unittest.cc b/src/processor/cfi_frame_info_unittest.cc index 8111437a..919aafac 100644 --- a/src/processor/cfi_frame_info_unittest.cc +++ b/src/processor/cfi_frame_info_unittest.cc @@ -254,8 +254,9 @@ TEST_F(Scope, RegsLackRA) { cfi.SetCFARule("42740329"); cfi.SetRARule("27045204"); cfi.SetRegisterRule("$r1", ".ra"); - ASSERT_FALSE(cfi.FindCallerRegs(registers, memory, - &caller_registers)); + ASSERT_TRUE(cfi.FindCallerRegs(registers, memory, + &caller_registers)); + ASSERT_EQ(caller_registers.end(), caller_registers.find("$r1")); } // Register rules can see the current frame's register values. @@ -439,6 +440,7 @@ TEST_F(ParseHandler, RegisterRules) { handler.RARule("reg-for-ra"); handler.RegisterRule("reg1", "reg-for-reg1"); handler.RegisterRule("reg2", "reg-for-reg2"); + handler.RegisterRule("reg3", "reg3"); registers["reg-for-cfa"] = 0x268a9a4a3821a797ULL; registers["reg-for-ra"] = 0x6301b475b8b91c02ULL; registers["reg-for-reg1"] = 0x06cde8e2ff062481ULL; @@ -449,6 +451,7 @@ TEST_F(ParseHandler, RegisterRules) { ASSERT_EQ(0x6301b475b8b91c02ULL, caller_registers[".ra"]); ASSERT_EQ(0x06cde8e2ff062481ULL, caller_registers["reg1"]); ASSERT_EQ(0xff0c4f76403173e2ULL, caller_registers["reg2"]); + ASSERT_EQ(caller_registers.end(), caller_registers.find("reg3")); } struct SimpleCFIWalkerFixture {