Skip to content

Commit 7124b4b

Browse files
committed
[analyzer] Revert the functional part of r155944.
The change resulted in multiple issues on the buildbot, so it's not ready for prime time. Only enable history tracking for tainted data(which is experimental) for now. llvm-svn: 156049
1 parent b64e7b7 commit 7124b4b

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

clang/lib/StaticAnalyzer/Core/SValBuilder.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,9 @@ SVal SValBuilder::makeSymExprValNN(ProgramStateRef State,
199199
BinaryOperator::Opcode Op,
200200
NonLoc LHS, NonLoc RHS,
201201
QualType ResultTy) {
202+
if (!State->isTainted(RHS) && !State->isTainted(LHS))
203+
return UnknownVal();
204+
202205
const SymExpr *symLHS = LHS.getAsSymExpr();
203206
const SymExpr *symRHS = RHS.getAsSymExpr();
204207

clang/test/Analysis/malloc.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -776,13 +776,6 @@ int rdar11269741(struct rdar11269741_b_t o)
776776
return p->n.m; // expected-warning {{leak}}
777777
}
778778

779-
// Pointer arithmetic, returning an ElementRegion.
780-
void *radar11329382(unsigned bl) {
781-
void *ptr = malloc (16);
782-
ptr = ptr + (2 - bl);
783-
return ptr; // no warning
784-
}
785-
786779
void __assert_rtn(const char *, const char *, int, const char *) __attribute__((__noreturn__));
787780
int strcmp(const char *, const char *);
788781
char *a (void);

0 commit comments

Comments
 (0)