aprantl added a comment.

In D59235#1426716 <https://reviews.llvm.org/D59235#1426716>, @JDevlieghere 
wrote:

> Agreed, and we've been doing this for new patches for a while now. However, I 
> very strongly prefer having asserts over "returning a default value", which 
> only hides real bugs.


I think everyone is on the same page here, but it doesn't hurt to explicitly 
repeat this  :-)

- Assertions should be used liberally to assert internal consistency and to 
enforce contracts in the API. Basically when you write an assertion, you should 
be already convinced that it will always hold.
- Assertions may never be used to handle invalid external input in a parser. 
Invalid external input must use error handling, expected, optional, ...


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

https://reviews.llvm.org/D59235



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

Reply via email to