Edwin Steiner
Christian Thalinger
- $Id: loader.c 2186 2005-04-02 00:43:25Z edwin $
+ $Id: loader.c 2189 2005-04-02 02:05:59Z edwin $
*/
switch (t) {
case CONSTANT_Class:
- nfc = NEW(forward_class);
+ nfc = DNEW(forward_class);
nfc->next = forward_classes;
forward_classes = nfc;
break;
case CONSTANT_String:
- nfs = NEW(forward_string);
+ nfs = DNEW(forward_string);
nfs->next = forward_strings;
forward_strings = nfs;
break;
case CONSTANT_NameAndType:
- nfn = NEW(forward_nameandtype);
+ nfn = DNEW(forward_nameandtype);
nfn->next = forward_nameandtypes;
forward_nameandtypes = nfn;
case CONSTANT_Fieldref:
case CONSTANT_Methodref:
case CONSTANT_InterfaceMethodref:
- nff = NEW(forward_fieldmethint);
+ nff = DNEW(forward_fieldmethint);
nff->next = forward_fieldmethints;
forward_fieldmethints = nff;
utf *name =
class_getconstant(c, forward_classes->name_index, CONSTANT_Utf8);
- if (opt_verify && !is_valid_name_utf(name))
- panic("Class reference with invalid name");
+ if (opt_verify && !is_valid_name_utf(name)) {
+ *exceptionptr =
+ new_classformaterror(c, "Class reference with invalid name");
+ return false;
+ }
cptags[forward_classes->thisindex] = CONSTANT_Class;
/* retrieve class from class-table */
nfc = forward_classes;
forward_classes = forward_classes->next;
- FREE(nfc, forward_class);
}
while (forward_strings) {
nfs = forward_strings;
forward_strings = forward_strings->next;
- FREE(nfs, forward_string);
}
while (forward_nameandtypes) {
nfn = forward_nameandtypes;
forward_nameandtypes = forward_nameandtypes->next;
- FREE(nfn, forward_nameandtype);
}
while (forward_fieldmethints) {
forward_fieldmethints->nameandtype_index,
CONSTANT_NameAndType);
- fmi->class = class_getconstant(c,
- forward_fieldmethints->class_index,
- CONSTANT_Class);
+ fmi->classref = (constant_classref*) (size_t) forward_fieldmethints->class_index;
fmi->name = nat->name;
fmi->descriptor = nat->descriptor;
nff = forward_fieldmethints;
forward_fieldmethints = forward_fieldmethints->next;
- FREE(nff, forward_fieldmethint);
}
/* everything was ok */
/* parse the loaded descriptors */
for (i=0; i<c->cpcount; ++i) {
constant_FMIref *fmi;
+ int index;
switch (c->cptags[i]) {
case CONSTANT_Class:
descriptor_pool_parse_field_descriptor(descpool,fmi->descriptor);
if (!fmi->parseddesc.fd)
goto return_exception;
- fmi->classref = descriptor_pool_lookup_classref(descpool,fmi->class->name);
+ index = (int) (size_t) fmi->classref;
+ fmi->classref = descriptor_pool_lookup_classref(descpool,((classinfo *)class_getconstant(c,index,CONSTANT_Class))->name);
break;
case CONSTANT_Methodref:
case CONSTANT_InterfaceMethodref:
descriptor_pool_parse_method_descriptor(descpool,fmi->descriptor);
if (!fmi->parseddesc.md)
goto return_exception;
- fmi->classref = descriptor_pool_lookup_classref(descpool,fmi->class->name);
+ index = (int) (size_t) fmi->classref;
+ fmi->classref = descriptor_pool_lookup_classref(descpool,((classinfo *)class_getconstant(c,index,CONSTANT_Class))->name);
break;
}
}
displayFMIi:
{
constant_FMIref *fmi = e;
- utf_display(fmi->class->name);
+ utf_display(fmi->classref->name);
printf(".");
utf_display(fmi->name);
printf(" ");
displayFMI:
{
constant_FMIref *fmi = e;
- utf_display ( fmi->class->name );
+ utf_display ( fmi->classref->name );
printf (".");
utf_display ( fmi->name);
printf (" ");