TBAA: try to fix the dragonegg bots.
[oota-llvm.git] / lib / Analysis / TypeBasedAliasAnalysis.cpp
index ef37bdccbfd1fa363ddc01906aa2493f249d31a8..9026dc9114348d86499a9cea885574f2f1d89bb6 100644 (file)
@@ -326,7 +326,9 @@ TypeBasedAliasAnalysis::getAnalysisUsage(AnalysisUsage &AU) const {
 /// it as struct-path aware TBAA format, otherwise, we treat it as scalar TBAA
 /// format.
 static bool isStructPathTBAA(const MDNode *MD) {
-  return isa<MDNode>(MD->getOperand(0));
+  // Anonymous TBAA root starts with a MDNode and dragonegg uses it as
+  // a TBAA tag.
+  return isa<MDNode>(MD->getOperand(0)) && MD->getNumOperands() >= 3;
 }
 
 /// Aliases - Test whether the type represented by A may alias the