> int x = *p;
> int x = strlen(ptr);
Both of these should either check for null, be in a situation where p is
obviously good (e.g., p is data() from a stack-allocated std::vector), or use
references. The assertion to my mind is like an admission "I'm not 100% sure,
so let me crash if I'm wrong..." – if we're making that admission and not doing
error handling, we're already a little shady.
lldb-dev mailing list