[Lldb-commits] [PATCH] D72413: Add missing nullptr checks.

Raphael Isemann via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Jan 10 00:12:42 PST 2020


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

In D72413#1811038 <https://reviews.llvm.org/D72413#1811038>, @aprantl wrote:

> In D72413#1810969 <https://reviews.llvm.org/D72413#1810969>, @jingham wrote:
>
> > If we can't make a persistent expression state, are we going to be able to do anything useful with expressions?  I don't see anything wrong here, but it seems like we should really be putting up a crunchy frog warning and erroring out of "expr"directly if we really can't make a type system.
>
>
> I looked at that for a bit, but there is no obvious place where to early exit without refactoring much more of ClangExpressionDeclMap.


FWIW, you could also just add the check to `ClangUserExpression::ClangUserExpressionHelper::ResetDeclMap` and return a nullptr there. The API is designed to return a nullptr for utility expressions on that don't use the DeclMap. That's the only place in upstream LLDB where we construct a DeclMap with a target, so if there is a check there then the DeclMap doesn't need any further changes and we can just assume there is a persistent state in the rest of the code. But it doesn't really make the code much better, just this patch smaller.


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

https://reviews.llvm.org/D72413





More information about the lldb-commits mailing list