Skip to content

Commit 0a9cbd4

Browse files
committedJul 29, 2016
[CFLAA] Check for pointer types in more places.
This patch fixes an assertion that fires when we try to add non-pointer Values to the CFLGraph. Centralizing the check for whether something is/isn't a pointer type isn't completely trivial (and, in some cases, would end up being entirely redundant), but it may be beneficial to do so if this trips us up more in the future. Patch by Jia Chen. Differential Revision: https://reviews.llvm.org/D22947 llvm-svn: 277096
1 parent 4c922ab commit 0a9cbd4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed
 

Diff for: ‎llvm/lib/Analysis/CFLGraph.h

+4-2
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,8 @@ template <typename CFLAA> class CFLGraphBuilder {
334334
// For now, we'll handle this like a landingpad instruction (by placing
335335
// the
336336
// result in its own group, and having that group alias externals).
337-
addNode(&Inst, getAttrUnknown());
337+
if (Inst.getType()->isPointerTy())
338+
addNode(&Inst, getAttrUnknown());
338339
}
339340

340341
static bool isFunctionExternal(Function *Fn) {
@@ -457,7 +458,8 @@ template <typename CFLAA> class CFLGraphBuilder {
457458
// Exceptions come from "nowhere", from our analysis' perspective.
458459
// So we place the instruction its own group, noting that said group may
459460
// alias externals
460-
addNode(&Inst, getAttrUnknown());
461+
if (Inst.getType()->isPointerTy())
462+
addNode(&Inst, getAttrUnknown());
461463
}
462464

463465
void visitInsertValueInst(InsertValueInst &Inst) {

0 commit comments

Comments
 (0)
Please sign in to comment.