summaryrefslogtreecommitdiff
path: root/test/Analysis/stack-addr-ps.cpp
Commit message (Collapse)AuthorAgeFilesLines
* When going through references to check if the function returns the addressArgyrios Kyrtzidis2012-04-301-0/+6
| | | | | | | | | | | | | | | | of a local variable, make sure we don't infinitely recurse when the reference binds to itself. e.g: int* func() { int& i = i; // assign non-exist variable to a reference which has same name. return &i; // return pointer } rdar://11345441 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155856 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix LiveVariables analysis bug with MaterializeTemporaryExpr and fix ↵Ted Kremenek2011-10-021-1/+1
| | | | | | handling in ExprEngine. Fixes <rdar://problem/10201666>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140956 91177308-0d34-0410-b5e6-96231b3b80d8
* Handle CXXTempObjectRegion in StackAddrEscapeChecker.Jeffrey Yasskin2011-08-261-18/+10
| | | | | | | | Also convert stack-addr-ps.cpp to use the analyzer instead of just Sema, now that it doesn't crash, and extract the stack-block test into another file since it errors, and that prevents the analyzer from running. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138613 91177308-0d34-0410-b5e6-96231b3b80d8
* Follow through references to catch returned stack addresses, local blocks, ↵Argyrios Kyrtzidis2010-11-301-0/+86
| | | | | | | | | | | | label addresses or references to temporaries, e.g: const int& g2() { int s1; int &s2 = s1; // expected-note {{binding reference variable 's2' here}} return s2; // expected-warning {{reference to stack memory associated with local variable 's1' returned}} } git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120483 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r120331 since it causes spurious warnings and a possible assertion ↵Argyrios Kyrtzidis2010-11-291-9/+0
| | | | | | hit when self-host. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120351 91177308-0d34-0410-b5e6-96231b3b80d8
* Emit warnings if we are returning a reference to a local temporary.Argyrios Kyrtzidis2010-11-291-0/+9
| | | | | | The issue was brought to our attention by Matthieu Monrocq. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120331 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach SemaChecking::CheckReturnStackAddr about ImplicitCastExprs that ↵Ted Kremenek2010-08-041-0/+8
convert values to an lvalue. This allows us to warn (again) about returning references to stack variables. (fixes PR 7812). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110242 91177308-0d34-0410-b5e6-96231b3b80d8