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 Frith-MacDonald 2000-10-26 14:12:44 +00:00
parent e9f8468afe
commit 59b06c4f30
2 changed files with 36 additions and 6 deletions

View file

@ -1,3 +1,11 @@
2000-10-26 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSData.m: When deserialising selectors, register new
selectors if they don't already exist - so we can unarchive a
selector into a program where no objects implements it (we might
still want to use it over DO or to store in another archive).
Change suggested by N.Pero.
2000-10-24 Adam Fedor <fedor@gnu.org>
* Source/NSCalendarDate.m (-initWithString:calendarFormat:locale:):

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;
}