Skip to content

Commit

Permalink
Die explicitly rather than with a null deref if the task died when se…
Browse files Browse the repository at this point in the history
…tting regs.
  • Loading branch information
khuey committed Apr 18, 2024
1 parent 1883109 commit ab68622
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/GdbServer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,9 @@ static bool set_reg(Task* target, const GdbRegisterValue& reg) {
return true;
}

ExtraRegisters extra_regs = *target->extra_regs_fallible();
auto extra_regs_p = target->extra_regs_fallible();
ASSERT(target, extra_regs_p) << "Task died";
ExtraRegisters extra_regs = *extra_regs_p;
if (extra_regs.write_register(reg.name, reg.value, reg.size)) {
target->set_extra_regs(extra_regs);
return true;
Expand Down

0 comments on commit ab68622

Please sign in to comment.