Make decoding of selectors tolerant.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@7906 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
richard 2000-10-26 14:12:44 +00:00
parent c5009fd6f6
commit 351270544e
2 changed files with 36 additions and 6 deletions

View file

@ -1121,9 +1121,20 @@ failure:
}
if (sel == 0)
{
[NSException raise: NSInternalInconsistencyException
format: @"can't find sel with name '%s' "
@"and types '%s'", name, types];
if (lt)
{
sel = sel_register_typed_name(name, types);
}
else
{
sel = sel_register_name(name);
}
if (sel == 0)
{
[NSException raise: NSInternalInconsistencyException
format: @"can't make sel with name '%s' "
@"and types '%s'", name, types];
}
}
*(SEL*)data = sel;
}
@ -2187,9 +2198,20 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos)
}
if (sel == 0)
{
[NSException raise: NSInternalInconsistencyException
format: @"can't find sel with name '%s' "
@"and types '%s'", name, types];
if (lt)
{
sel = sel_register_typed_name(name, types);
}
else
{
sel = sel_register_name(name);
}
if (sel == 0)
{
[NSException raise: NSInternalInconsistencyException
format: @"can't make sel with name '%s' "
@"and types '%s'", name, types];
}
}
*(SEL*)data = sel;
}