jingham accepted this revision.
jingham added a comment.
This revision is now accepted and ready to land.

Actually, I think this is 100% correct, and corrects an error I made when I 
added argument number checking a little while back.

The comments on CheckRequirements say:

Every command should call

  // CommandObject::Cleanup() after it has completed.

The early exit in the error case bypassed the call to cleanup that the command 
was required to do.  The m_exe_ctx is probably the less important part of the 
cleanup that gets missed.  If you called a command that has 
eCommandTryTargetAPILock set in its requirements, but passed it the wrong 
number of arguments, then we would error out here w/o releasing the m_api_lock, 
and then if the next command was also a CommandObjectParsed command and 
required the API lock, it would deadlock.  You could probably even write a test 
that would show this deadlock.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D132397/new/

https://reviews.llvm.org/D132397

_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to