[Lldb-commits] [PATCH] D108717: Fix Reference case for TypeSystemClang::GetChildCompilerTypeAtIndex(...) to avoid possible invalid cast

2021-08-26 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor added inline comments. Comment at: lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp:6505 if (idx_is_valid) { - const clang::ReferenceType *reference_type = - llvm::cast(GetQualType(type).getTypePtr()); - CompilerType pointee_clang_type =

[Lldb-commits] [PATCH] D108717: Fix Reference case for TypeSystemClang::GetChildCompilerTypeAtIndex(...) to avoid possible invalid cast

2021-08-25 Thread Shafik Yaghmour via Phabricator via lldb-commits
shafik added a comment. In D108717#2965815 , @teemperor wrote: > Thanks for the patch! > > So IIUC correctly this fixes a crash when calling `Dereference` on an SBValue > that is of type `SomeTypedef` with `typedef int& SomeTypedef`? If yes, then I >

[Lldb-commits] [PATCH] D108717: Fix Reference case for TypeSystemClang::GetChildCompilerTypeAtIndex(...) to avoid possible invalid cast

2021-08-25 Thread Shafik Yaghmour via Phabricator via lldb-commits
shafik added inline comments. Comment at: lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp:6508 + if (parent_type_class == clang::Type::LValueReference) +pointee_clang_type = GetLValueReferenceType(type).GetPointeeType(); + else

[Lldb-commits] [PATCH] D108717: Fix Reference case for TypeSystemClang::GetChildCompilerTypeAtIndex(...) to avoid possible invalid cast

2021-08-25 Thread Shafik Yaghmour via Phabricator via lldb-commits
shafik added inline comments. Comment at: lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp:6505 if (idx_is_valid) { - const clang::ReferenceType *reference_type = - llvm::cast(GetQualType(type).getTypePtr()); - CompilerType pointee_clang_type = -

[Lldb-commits] [PATCH] D108717: Fix Reference case for TypeSystemClang::GetChildCompilerTypeAtIndex(...) to avoid possible invalid cast

2021-08-25 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor requested changes to this revision. teemperor added a comment. This revision now requires changes to proceed. Thanks for the patch! So IIUC correctly this fixes a crash when calling `Dereference` on an SBValue that is of type `SomeTypedef` with `typedef int& SomeTypedef`? If yes, then

[Lldb-commits] [PATCH] D108717: Fix Reference case for TypeSystemClang::GetChildCompilerTypeAtIndex(...) to avoid possible invalid cast

2021-08-25 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl added inline comments. Comment at: lldb/test/API/lang/cpp/null_references/TestNullReferences.py:14 + +self.runCmd("continue") Why is the `continue` necessary and what is it actually that's triggering the crash? CHANGES SINCE LAST ACTION

[Lldb-commits] [PATCH] D108717: Fix Reference case for TypeSystemClang::GetChildCompilerTypeAtIndex(...) to avoid possible invalid cast

2021-08-25 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl accepted this revision. aprantl added a comment. This revision is now accepted and ready to land. That looks obviously correct, thanks! Comment at: lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp:6506 + CompilerType pointee_clang_type; + + if

[Lldb-commits] [PATCH] D108717: Fix Reference case for TypeSystemClang::GetChildCompilerTypeAtIndex(...) to avoid possible invalid cast

2021-08-25 Thread Shafik Yaghmour via Phabricator via lldb-commits
shafik created this revision. shafik added reviewers: aprantl, teemperor, werat. Herald added a subscriber: arphaman. shafik requested review of this revision. D103532 modified this case to preserve type sugar but we can end up with cases where the cast is not