Someone pointed out and provide an excellent test case to help me fix a
bug dealing with objname-less objects and corruption of the object file.
diff -u -u -r1.14 dbpack.c
--- dbpack.c 1998/08/27 04:07:13 1.14
+++ dbpack.c 2001/06/07 08:29:31
@@ -191,7 +191,12 @@
Long size_ident(Long id)
{
- Int len = strlen(ident_name(id));
+ Int len;
+
+ if (id == NOT_AN_IDENT)
+ return size_long(NOT_AN_IDENT);
+
+ len = strlen(ident_name(id));
return size_long(len) + (len * sizeof(Char));
}
@@ -817,8 +822,7 @@
size += size_methods(obj);
size += size_strings(obj);
size += size_idents(obj);
- if (obj->objname != -1)
- size += size_ident(obj->objname);
+ size += size_ident(obj->objname);
#if 0
size += size_long(obj->search);
#endif
This bug has been around since, well, as far back as I had code in cvs to
look at (0.3 era stuff).
Later,
Brad
|