Skip to content

Commit b0525f6

Browse files
committed
[NFC][CLANG] [NFC][CLANG] Fix nullptr dereference issue in ConvertQualTypeToKind()
This patch uses castAs instead of getAs which will assert if the type doesn't match in ConvertQualTypeToKind(clang::ASTContext const &, clang::QualType). Reviewed By: erichkeane Differential Revision: https://reviews.llvm.org/D151928
1 parent c755031 commit b0525f6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clang/lib/Interpreter/Value.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ static Value::Kind ConvertQualTypeToKind(const ASTContext &Ctx, QualType QT) {
108108
if (!BT || BT->isNullPtrType())
109109
return Value::K_PtrOrObj;
110110

111-
switch (QT->getAs<BuiltinType>()->getKind()) {
111+
switch (QT->castAs<BuiltinType>()->getKind()) {
112112
default:
113113
assert(false && "Type not supported");
114114
return Value::K_Unspecified;

0 commit comments

Comments
 (0)