summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExprCXX.cpp
diff options
context:
space:
mode:
authorKaelyn Uhrain <rikka@google.com>2011-08-05 23:18:04 +0000
committerKaelyn Uhrain <rikka@google.com>2011-08-05 23:18:04 +0000
commit2e7aa5ae1f702c06776dd52861703f88beedf88b (patch)
treea5f33ee772580bad51d3e5b502dc47b498b13361 /clang/lib/Sema/SemaExprCXX.cpp
parent0de95ef7f54e83e9b6773b953c8b3ec11b87893a (diff)
downloadbcm5719-llvm-2e7aa5ae1f702c06776dd52861703f88beedf88b.tar.gz
bcm5719-llvm-2e7aa5ae1f702c06776dd52861703f88beedf88b.zip
Perform array bounds checking in more situations and properly handle special
case situations with the unary operators & and *. Also extend the array bounds checking to work with pointer arithmetic; the pointer arithemtic checking can be turned on using -Warray-bounds-pointer-arithmetic. The changes to where CheckArrayAccess gets called is based on some trial & error and a bunch of digging through source code and gdb backtraces in order to have the check performed under as many situations as possible (such as for variable initializers, arguments to function calls, and within conditional in addition to the simpler cases of the operands to binary and unary operator) while not being called--and triggering warnings--more than once for a given ArraySubscriptExpr. llvm-svn: 136997
Diffstat (limited to 'clang/lib/Sema/SemaExprCXX.cpp')
-rw-r--r--clang/lib/Sema/SemaExprCXX.cpp3
1 files changed, 0 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp
index ef4944ec357..4f4946384d8 100644
--- a/clang/lib/Sema/SemaExprCXX.cpp
+++ b/clang/lib/Sema/SemaExprCXX.cpp
@@ -2264,9 +2264,6 @@ Sema::PerformImplicitConversion(Expr *From, QualType ToType,
if (!From->isGLValue()) break;
}
- // Check for trivial buffer overflows.
- CheckArrayAccess(From);
-
FromType = FromType.getUnqualifiedType();
From = ImplicitCastExpr::Create(Context, FromType, CK_LValueToRValue,
From, 0, VK_RValue);
OpenPOWER on IntegriCloud