cvsuser 04/08/27 06:16:37
Modified: src dynext.c
Log:
fix segfault related to library loading and DOD
Revision Changes Path
1.28 +10 -8 parrot/src/dynext.c
Index: dynext.c
===================================================================
RCS file: /cvs/public/parrot/src/dynext.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -w -r1.27 -r1.28
--- dynext.c 23 Aug 2004 09:10:02 -0000 1.27
+++ dynext.c 27 Aug 2004 13:16:37 -0000 1.28
@@ -1,6 +1,6 @@
/*
Copyright: 2001-2003 The Perl Foundation. All Rights Reserved.
-$Id: dynext.c,v 1.27 2004/08/23 09:10:02 leo Exp $
+$Id: dynext.c,v 1.28 2004/08/27 13:16:37 leo Exp $
=head1 NAME
@@ -230,7 +230,6 @@
PMC *(*load_func)(Interp *),
void (*init_func)(Interp *, PMC *))
{
- STRING *type;
PMC *lib_pmc;
if (!load_func) {
@@ -241,15 +240,9 @@
* s. also build_tools/ops2c.pl and lib/Parrot/Pmc2c.pm
*/
lib_pmc = pmc_new(interpreter, enum_class_ParrotLibrary);
- type = const_string(interpreter, "NCI");
}
else {
lib_pmc = (*load_func)(interpreter);
- /* we could set a private flag in the PMC header too
- * but currently only ops files have struct_val set
- */
- type = const_string(interpreter,
- PMC_struct_val(lib_pmc) ? "Ops" : "PMC");
}
/*
* call init, if it exists
@@ -315,6 +308,15 @@
lib_pmc = Parrot_init_lib(interpreter, load_func, init_func);
PMC_data(lib_pmc) = handle;
+ if (!load_func)
+ type = const_string(interpreter, "NCI");
+ else {
+ /* we could set a private flag in the PMC header too
+ * but currently only ops files have struct_val set
+ */
+ type = const_string(interpreter,
+ PMC_struct_val(lib_pmc) ? "Ops" : "PMC");
+ }
/*
* remember lib_pmc in iglobals
*/