[cfe-commits] r77831 - /cfe/trunk/lib/AST/DeclCXX.cpp
Daniel Dunbar
daniel at zuster.org
Sat Aug 1 16:40:20 PDT 2009
Author: ddunbar
Date: Sat Aug 1 18:40:20 2009
New Revision: 77831
URL: http://llvm.org/viewvc/llvm-project?rev=77831&view=rev
Log:
Avoid accessing invalid std::vector element; this makes clang
ENABLE_EXPENSIVE_CHECKS clean on x86_64-.*-darwin10.
Modified:
cfe/trunk/lib/AST/DeclCXX.cpp
Modified: cfe/trunk/lib/AST/DeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclCXX.cpp?rev=77831&r1=77830&r2=77831&view=diff
==============================================================================
--- cfe/trunk/lib/AST/DeclCXX.cpp (original)
+++ cfe/trunk/lib/AST/DeclCXX.cpp Sat Aug 1 18:40:20 2009
@@ -348,8 +348,9 @@
return 0;
OverriddenMethodsMapTy::iterator it = OverriddenMethods->find(this);
- if (it == OverriddenMethods->end())
+ if (it == OverriddenMethods->end() || it->second->empty())
return 0;
+
return &(*it->second)[0];
}
@@ -358,7 +359,7 @@
return 0;
OverriddenMethodsMapTy::iterator it = OverriddenMethods->find(this);
- if (it == OverriddenMethods->end())
+ if (it == OverriddenMethods->end() || it->second->empty())
return 0;
return &(*it->second)[it->second->size()];
More information about the cfe-commits
mailing list