diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2009-07-16 17:59:14 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2009-07-16 17:59:14 +0000 |
commit | 9f8a04f3ed589de0a2e9fec855177dc0f185bfa9 (patch) | |
tree | 5c201373370e0512b56450e9bfc65e7c74853d63 /lib | |
parent | 9d4a15fd3b85434c43ea27562793de63a793321a (diff) |
Diagnose ++/-- op on objc pointers in
nonfragile abi, instead of crashing.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76088 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Sema/SemaExpr.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index 4b3f40aa93..1304558042 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -4603,6 +4603,12 @@ QualType Sema::CheckIncrementDecrementOperand(Expr *Op, SourceLocation OpLoc, Op->getSourceRange(), SourceRange(), ResType)) return QualType(); + // Diagnose bad cases where we step over interface counts. + else if (PointeeTy->isObjCInterfaceType() && LangOpts.ObjCNonFragileABI) { + Diag(OpLoc, diag::err_arithmetic_nonfragile_interface) + << PointeeTy << Op->getSourceRange(); + return QualType(); + } } else if (ResType->isComplexType()) { // C99 does not support ++/-- on complex types, we allow as an extension. Diag(OpLoc, diag::ext_integer_increment_complex) |