From: David S. W. <dw...@us...> - 2008-01-28 18:16:51
|
Update of /cvsroot/xsb/XSB/emu In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv17128 Modified Files: builtin.c Log Message: import can be called before flags[CURRENT_MODULE] is initialized, so use global_mod in this case. (Noticed when debugging something else; This seemed to end up working before, but only by a fluke.) Index: builtin.c =================================================================== RCS file: /cvsroot/xsb/XSB/emu/builtin.c,v retrieving revision 1.306 retrieving revision 1.307 diff -u -r1.306 -r1.307 --- builtin.c 21 Jan 2008 18:07:28 -0000 1.306 +++ builtin.c 28 Jan 2008 18:16:49 -0000 1.307 @@ -1642,7 +1642,9 @@ if (value) /* if predicate is new */ set_data(pair_psc(sym), (psc)); env_type_set(pair_psc(sym), T_IMPORTED, T_ORDI, (xsbBool)value); - link_sym(pair_psc(sym), (Psc)flags[CURRENT_MODULE]); + if (flags[CURRENT_MODULE]) /* in case before flags is initted */ + link_sym(pair_psc(sym), (Psc)flags[CURRENT_MODULE]); + else link_sym(pair_psc(sym), global_mod); break; } |