Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions clang/lib/Analysis/UnsafeBufferUsage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,11 +247,11 @@ class MatchDescendantVisitor : public DynamicRecursiveASTVisitor {

// Because we're dealing with raw pointers, let's define what we mean by that.
static bool hasPointerType(const Expr &E) {
return isa<PointerType>(E.getType().getCanonicalType());
return isa<clang::PointerType>(E.getType().getCanonicalType());
}

static bool hasArrayType(const Expr &E) {
return isa<ArrayType>(E.getType().getCanonicalType());
return isa<clang::ArrayType>(E.getType().getCanonicalType());
}

static void
Expand Down Expand Up @@ -968,7 +968,8 @@ static bool hasUnsafePrintfStringArg(const CallExpr &Node, ASTContext &Ctx,
if (!FirstParmTy->isPointerType())
return false; // possibly some user-defined printf function

QualType FirstPteTy = FirstParmTy->castAs<PointerType>()->getPointeeType();
QualType FirstPteTy =
FirstParmTy->castAs<clang::PointerType>()->getPointeeType();

if (!Ctx.getFILEType()
.isNull() && //`FILE *` must be in the context if it is fprintf
Expand Down Expand Up @@ -1052,7 +1053,8 @@ static bool hasUnsafeSnprintfBuffer(const CallExpr &Node,
if (!FirstParmTy->isPointerType())
return false; // Not an snprint

QualType FirstPteTy = FirstParmTy->castAs<PointerType>()->getPointeeType();
QualType FirstPteTy =
FirstParmTy->castAs<clang::PointerType>()->getPointeeType();
const Expr *Buf = Node.getArg(0), *Size = Node.getArg(1);

if (FirstPteTy.isConstQualified() || !Buf->getType()->isPointerType() ||
Expand Down
Loading