Skip to content
Snippets Groups Projects
Commit d7d58689 authored by Bianca Cristina Cristescu's avatar Bianca Cristina Cristescu Committed by Axel Naumann
Browse files

Enable the NullDeref Cling test for MethodCalls.

parent d52ad51e
No related branches found
No related tags found
No related merge requests found
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
// RUN: cat %s | %cling -Xclang -verify // RUN: cat %s | %cling -Xclang -verify
// This test verifies that we get nice warning if a method on null ptr object is // This test verifies that we get nice warning if a method on null ptr object is
// called. // called.
// XFAIL:*
extern "C" int printf(const char* fmt, ...); extern "C" int printf(const char* fmt, ...);
class MyClass { class MyClass {
private: private:
...@@ -19,7 +19,7 @@ public: ...@@ -19,7 +19,7 @@ public:
int getA(){return a;} int getA(){return a;}
}; };
MyClass* my = 0; MyClass* my = 0;
my->getA() // expected-warning {{you are about to dereference null ptr, which probably will lead to seg violation. Do you want to proceed?[y/n]}} my->getA() // expected-warning {{null passed to a callee that requires a non-null argument}}
struct AggregatedNull { struct AggregatedNull {
MyClass* m; MyClass* m;
...@@ -27,6 +27,6 @@ struct AggregatedNull { ...@@ -27,6 +27,6 @@ struct AggregatedNull {
} }
AggregatedNull agrNull; AggregatedNull agrNull;
agrNull.m->getA(); // expected-warning {{you are about to dereference null ptr, which probably will lead to seg violation. Do you want to proceed?[y/n]}} agrNull.m->getA(); // expected-warning {{null passed to a callee that requires a non-null argument}}
.q .q
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment