diff options
| author | Kristof Umann <dkszelethus@gmail.com> | 2018-08-21 10:45:21 +0000 |
|---|---|---|
| committer | Kristof Umann <dkszelethus@gmail.com> | 2018-08-21 10:45:21 +0000 |
| commit | 646019655c2e152ab0655033a33bc39b4fac6bc5 (patch) | |
| tree | e66ffd99ca36878a20ef9855d831220d50760fdb /clang/test | |
| parent | 8e15b430929c775de731e8218dfb26761042419b (diff) | |
| download | bcm5719-llvm-646019655c2e152ab0655033a33bc39b4fac6bc5.tar.gz bcm5719-llvm-646019655c2e152ab0655033a33bc39b4fac6bc5.zip | |
[analyzer][UninitializedObjectChecker] Refactoring p6.: Move dereferencing to a function
Now that it has it's own file, it makes little sense for
isPointerOrReferenceUninit to be this large, so I moved
dereferencing to a separate function.
Differential Revision: https://reviews.llvm.org/D50509
llvm-svn: 340265
Diffstat (limited to 'clang/test')
| -rw-r--r-- | clang/test/Analysis/cxx-uninitialized-object-ptr-ref.cpp | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/clang/test/Analysis/cxx-uninitialized-object-ptr-ref.cpp b/clang/test/Analysis/cxx-uninitialized-object-ptr-ref.cpp index eb7ac2590d0..f214a86adfc 100644 --- a/clang/test/Analysis/cxx-uninitialized-object-ptr-ref.cpp +++ b/clang/test/Analysis/cxx-uninitialized-object-ptr-ref.cpp @@ -194,15 +194,28 @@ void fCharPointerTest() { CharPointerTest(); } -struct CyclicPointerTest { +struct CyclicPointerTest1 { int *ptr; - CyclicPointerTest() : ptr(reinterpret_cast<int *>(&ptr)) {} + CyclicPointerTest1() : ptr(reinterpret_cast<int *>(&ptr)) {} }; -void fCyclicPointerTest() { - CyclicPointerTest(); +void fCyclicPointerTest1() { + CyclicPointerTest1(); } +// TODO: Currently, the checker ends up in an infinite loop for the following +// test case. +/* +struct CyclicPointerTest2 { + int **pptr; + CyclicPointerTest2() : pptr(reinterpret_cast<int **>(&pptr)) {} +}; + +void fCyclicPointerTest2() { + CyclicPointerTest2(); +} +*/ + //===----------------------------------------------------------------------===// // Void pointer tests. //===----------------------------------------------------------------------===// |

