mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 16:30:41 +00:00
check for use of uninitialized exception
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29936 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
a83ae2b69d
commit
9dfc6b7a26
1 changed files with 45 additions and 40 deletions
|
@ -899,6 +899,51 @@ callUncaughtHandler(id value)
|
||||||
[super dealloc];
|
[super dealloc];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (NSString*) description
|
||||||
|
{
|
||||||
|
CREATE_AUTORELEASE_POOL(pool);
|
||||||
|
NSString *result;
|
||||||
|
|
||||||
|
if (_e_name == nil)
|
||||||
|
{
|
||||||
|
[NSException raise: NSInvalidArgumentException
|
||||||
|
format: @"Atttempt to use uninitialised NSException"];
|
||||||
|
}
|
||||||
|
if (_reserved != 0)
|
||||||
|
{
|
||||||
|
if (_e_stack != nil
|
||||||
|
&& GSPrivateEnvironmentFlag("GNUSTEP_STACK_TRACE", NO) == YES)
|
||||||
|
{
|
||||||
|
if (_e_info != nil)
|
||||||
|
{
|
||||||
|
result = [NSString stringWithFormat:
|
||||||
|
@"%@ NAME:%@ REASON:%@ INFO:%@ STACK:%@",
|
||||||
|
[super description], _e_name, _e_reason, _e_info, _e_stack];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
result = [NSString stringWithFormat:
|
||||||
|
@"%@ NAME:%@ REASON:%@ STACK:%@",
|
||||||
|
[super description], _e_name, _e_reason, _e_stack];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
result = [NSString stringWithFormat:
|
||||||
|
@"%@ NAME:%@ REASON:%@ INFO:%@",
|
||||||
|
[super description], _e_name, _e_reason, _e_info];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
result = [NSString stringWithFormat: @"%@ NAME:%@ REASON:%@",
|
||||||
|
[super description], _e_name, _e_reason];
|
||||||
|
}
|
||||||
|
IF_NO_GC([result retain];)
|
||||||
|
IF_NO_GC(DESTROY(pool);)
|
||||||
|
return AUTORELEASE(result);
|
||||||
|
}
|
||||||
|
|
||||||
- (void) raise
|
- (void) raise
|
||||||
{
|
{
|
||||||
if (_reserved == 0)
|
if (_reserved == 0)
|
||||||
|
@ -1031,46 +1076,6 @@ callUncaughtHandler(id value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSString*) description
|
|
||||||
{
|
|
||||||
CREATE_AUTORELEASE_POOL(pool);
|
|
||||||
NSString *result;
|
|
||||||
|
|
||||||
if (_reserved != 0)
|
|
||||||
{
|
|
||||||
if (_e_stack != nil
|
|
||||||
&& GSPrivateEnvironmentFlag("GNUSTEP_STACK_TRACE", NO) == YES)
|
|
||||||
{
|
|
||||||
if (_e_info != nil)
|
|
||||||
{
|
|
||||||
result = [NSString stringWithFormat:
|
|
||||||
@"%@ NAME:%@ REASON:%@ INFO:%@ STACK:%@",
|
|
||||||
[super description], _e_name, _e_reason, _e_info, _e_stack];
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
result = [NSString stringWithFormat:
|
|
||||||
@"%@ NAME:%@ REASON:%@ STACK:%@",
|
|
||||||
[super description], _e_name, _e_reason, _e_stack];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
result = [NSString stringWithFormat:
|
|
||||||
@"%@ NAME:%@ REASON:%@ INFO:%@",
|
|
||||||
[super description], _e_name, _e_reason, _e_info];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
result = [NSString stringWithFormat: @"%@ NAME:%@ REASON:%@",
|
|
||||||
[super description], _e_name, _e_reason];
|
|
||||||
}
|
|
||||||
IF_NO_GC([result retain];)
|
|
||||||
IF_NO_GC(DESTROY(pool);)
|
|
||||||
return AUTORELEASE(result);
|
|
||||||
}
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation NSException (GSPrivate)
|
@implementation NSException (GSPrivate)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue