[Lldb-commits] [PATCH] D83327: [lldb/Core] Fix incomplete type variable dereferencing crash.
Jonas Devlieghere via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Tue Jul 7 10:45:46 PDT 2020
JDevlieghere added inline comments.
================
Comment at: lldb/source/Core/ValueObject.cpp:691
+ if (!valobj && synthetic_array_member) {
+ auto synth_valobj = GetSyntheticValue();
+ if (!synth_valobj)
----------------
Style-nit: I think few people love early returns a much as I do, but here I think the llvm-way of checking a pointer is would be preferable over a very-late-early-exit:
```
if (auto* synth_valobj = GetSyntheticValue()) {
valobj =
synth_valobj->GetChildAtIndex(synthetic_index, synthetic_array_member)
.get();
}
```
Additionally, I'm not sure if this should be `auto` according to the LLVM coding rules.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D83327/new/
https://reviews.llvm.org/D83327
More information about the lldb-commits
mailing list