[cfe-commits] r113554 - in /cfe/trunk: lib/Checker/CallAndMessageChecker.cpp test/Analysis/misc-ps-region-store.m test/Analysis/misc-ps.m test/Analysis/null-deref-ps.c test/Analysis/uninit-msg-expr.m test/Analysis/uninit-ps-rdar6145427.m test/Analysis/uninit-vals-ps.c
Ted Kremenek
kremenek at apple.com
Thu Sep 9 15:51:56 PDT 2010
Author: kremenek
Date: Thu Sep 9 17:51:55 2010
New Revision: 113554
URL: http://llvm.org/viewvc/llvm-project?rev=113554&view=rev
Log:
Clean up obtuse wording of checker diagnostic of using an uninitialized value in a function call.
Fixes: <rdar://problem/8409480> “warning: Pass-by-value argument in function call is undefined” message can be improved
Modified:
cfe/trunk/lib/Checker/CallAndMessageChecker.cpp
cfe/trunk/test/Analysis/misc-ps-region-store.m
cfe/trunk/test/Analysis/misc-ps.m
cfe/trunk/test/Analysis/null-deref-ps.c
cfe/trunk/test/Analysis/uninit-msg-expr.m
cfe/trunk/test/Analysis/uninit-ps-rdar6145427.m
cfe/trunk/test/Analysis/uninit-vals-ps.c
Modified: cfe/trunk/lib/Checker/CallAndMessageChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Checker/CallAndMessageChecker.cpp?rev=113554&r1=113553&r2=113554&view=diff
==============================================================================
--- cfe/trunk/lib/Checker/CallAndMessageChecker.cpp (original)
+++ cfe/trunk/lib/Checker/CallAndMessageChecker.cpp Thu Sep 9 17:51:55 2010
@@ -193,7 +193,7 @@
if (L.isUndef()) {
if (!BT_call_undef)
BT_call_undef =
- new BuiltinBug("Called function pointer is an undefined pointer value");
+ new BuiltinBug("Called function pointer is an uninitalized pointer value");
EmitBadCall(BT_call_undef, C, CE);
return;
}
@@ -208,8 +208,8 @@
for (CallExpr::const_arg_iterator I = CE->arg_begin(), E = CE->arg_end();
I != E; ++I)
if (PreVisitProcessArg(C, *I,
- "Pass-by-value argument in function call is"
- " undefined", BT_call_arg))
+ "Function call argument is an uninitialized value",
+ BT_call_arg))
return;
}
@@ -224,7 +224,7 @@
if (ExplodedNode *N = C.GenerateSink()) {
if (!BT_msg_undef)
BT_msg_undef =
- new BuiltinBug("Receiver in message expression is a garbage value");
+ new BuiltinBug("Receiver in message expression is an uninitialized value");
EnhancedBugReport *R =
new EnhancedBugReport(*BT_msg_undef, BT_msg_undef->getName(), N);
R->addRange(receiver->getSourceRange());
@@ -239,8 +239,8 @@
for (ObjCMessageExpr::const_arg_iterator I = ME->arg_begin(),
E = ME->arg_end(); I != E; ++I)
if (PreVisitProcessArg(C, *I,
- "Pass-by-value argument in message expression "
- "is undefined", BT_msg_arg))
+ "Argument in message expression "
+ "is an uninitialized value", BT_msg_arg))
return;
}
Modified: cfe/trunk/test/Analysis/misc-ps-region-store.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/misc-ps-region-store.m?rev=113554&r1=113553&r2=113554&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/misc-ps-region-store.m (original)
+++ cfe/trunk/test/Analysis/misc-ps-region-store.m Thu Sep 9 17:51:55 2010
@@ -394,7 +394,7 @@
int rdar_7332673_test2_aux(char *x);
void rdar_7332673_test2() {
char *value;
- if ( rdar_7332673_test2_aux(value) != 1 ) {} // expected-warning{{Pass-by-value argument in function call is undefined}}
+ if ( rdar_7332673_test2_aux(value) != 1 ) {} // expected-warning{{Function call argument is an uninitialized value}}
}
//===----------------------------------------------------------------------===//
@@ -671,7 +671,7 @@
builder = ^(id object) {
id x;
if (object) {
- builder(x); // expected-warning{{Pass-by-value argument in function call is undefined}}
+ builder(x); // expected-warning{{Function call argument is an uninitialized value}}
}
};
builder(target);
Modified: cfe/trunk/test/Analysis/misc-ps.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/misc-ps.m?rev=113554&r1=113553&r2=113554&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/misc-ps.m (original)
+++ cfe/trunk/test/Analysis/misc-ps.m Thu Sep 9 17:51:55 2010
@@ -794,7 +794,7 @@
void test_bad_call_aux(int x);
void test_bad_call(void) {
int y;
- test_bad_call_aux(y); // expected-warning{{Pass-by-value argument in function call is undefined}}
+ test_bad_call_aux(y); // expected-warning{{Function call argument is an uninitialized value}}
}
@interface TestBadArg {}
@@ -803,7 +803,7 @@
void test_bad_msg(TestBadArg *p) {
int y;
- [p testBadArg:y]; // expected-warning{{Pass-by-value argument in message expression is undefined}}
+ [p testBadArg:y]; // expected-warning{{Argument in message expression is an uninitialized value}}
}
//===----------------------------------------------------------------------===//
Modified: cfe/trunk/test/Analysis/null-deref-ps.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/null-deref-ps.c?rev=113554&r1=113553&r2=113554&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/null-deref-ps.c (original)
+++ cfe/trunk/test/Analysis/null-deref-ps.c Thu Sep 9 17:51:55 2010
@@ -288,7 +288,7 @@
void pr4759() {
int *p;
- pr4759_aux(p); // expected-warning{{undefined}}
+ pr4759_aux(p); // expected-warning{{Function call argument is an uninitialized value}}
}
Modified: cfe/trunk/test/Analysis/uninit-msg-expr.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/uninit-msg-expr.m?rev=113554&r1=113553&r2=113554&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/uninit-msg-expr.m (original)
+++ cfe/trunk/test/Analysis/uninit-msg-expr.m Thu Sep 9 17:51:55 2010
@@ -42,7 +42,7 @@
unsigned f1() {
NSString *aString;
- return [aString length]; // expected-warning {{Receiver in message expression is a garbage value}}
+ return [aString length]; // expected-warning {{Receiver in message expression is an uninitialized value}}
}
unsigned f2() {
@@ -53,5 +53,5 @@
void f3() {
NSMutableArray *aArray = [NSArray array];
NSString *aString;
- [aArray addObject:aString]; // expected-warning {{Pass-by-value argument in message expression is undefined.}}
+ [aArray addObject:aString]; // expected-warning {{Argument in message expression is an uninitialized value}}
}
Modified: cfe/trunk/test/Analysis/uninit-ps-rdar6145427.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/uninit-ps-rdar6145427.m?rev=113554&r1=113553&r2=113554&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/uninit-ps-rdar6145427.m (original)
+++ cfe/trunk/test/Analysis/uninit-ps-rdar6145427.m Thu Sep 9 17:51:55 2010
@@ -30,7 +30,7 @@
int main (int argc, const char * argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
- id someUnintializedPointer = [someUnintializedPointer objectAtIndex:0]; // expected-warning{{Receiver in message expression is a garbage value}}
+ id someUnintializedPointer = [someUnintializedPointer objectAtIndex:0]; // expected-warning{{Receiver in message expression is an uninitialized value}}
NSLog(@"%@", someUnintializedPointer);
[pool drain];
return 0;
Modified: cfe/trunk/test/Analysis/uninit-vals-ps.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/uninit-vals-ps.c?rev=113554&r1=113553&r2=113554&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/uninit-vals-ps.c (original)
+++ cfe/trunk/test/Analysis/uninit-vals-ps.c Thu Sep 9 17:51:55 2010
@@ -15,7 +15,7 @@
int f1_b() {
int x;
- return bar(x)+1; // expected-warning{{Pass-by-value argument in function call is undefined.}}
+ return bar(x)+1; // expected-warning{{Function call argument is an uninitialized value}}
}
int f2() {
More information about the cfe-commits
mailing list