diff --git a/lib/master.pike.in b/lib/master.pike.in index 7cd0de1d390c6898179e9cffef04141c2343f06b..f45c64ea3dc90d200c0853446bdd143c5c1746fa 100644 --- a/lib/master.pike.in +++ b/lib/master.pike.in @@ -1,6 +1,6 @@ /* -*- Pike -*- * - * $Id: master.pike.in,v 1.116 2000/04/13 18:54:16 per Exp $ + * $Id: master.pike.in,v 1.117 2000/05/07 00:39:52 hubbe Exp $ * * Master-file for Pike. * @@ -589,17 +589,25 @@ object cast_to_object(string oname, string current_file) class dirnode { string dirname; - mixed module; + mixed module=module_checker(); mapping(string:mixed) cache=([]); array(string) files; void create(string name) { dirname=name; + } - if(module=findmodule(dirname+"/module")) - if(mixed tmp=module->_module_value) - module=tmp; + class module_checker + { + int `!() + { + module=0; + if(module=findmodule(dirname+"/module")) + if(mixed tmp=module->_module_value) + module=tmp; + return !module; + } } static mixed ind(string index) diff --git a/src/builtin_functions.c b/src/builtin_functions.c index 2f0fc1d544356f3da4b57eac07dd10b8030b35ab..d72bb411f1023c670682a6cdd67e233152c5f4af 100644 --- a/src/builtin_functions.c +++ b/src/builtin_functions.c @@ -5,7 +5,7 @@ \*/ /**/ #include "global.h" -RCSID("$Id: builtin_functions.c,v 1.272 2000/05/05 07:55:19 hubbe Exp $"); +RCSID("$Id: builtin_functions.c,v 1.273 2000/05/07 00:39:17 hubbe Exp $"); #include "interpret.h" #include "svalue.h" #include "pike_macros.h" @@ -2748,12 +2748,12 @@ void f_column(INT32 args) for(e=0;e<a->size;e++) index_no_free(ITEM(a)+e, ITEM(tmp)+e, val); - END_CYCLIC(); sp--; dmalloc_touch_svalue(sp); pop_n_elems(args); push_array(a); } + END_CYCLIC(); } #ifdef PIKE_DEBUG diff --git a/src/cyclic.c b/src/cyclic.c index 62e87a83ac440423f7c16403bab6d9873d3aefd4..14bf52d56100511bb9a3966a5c698349178c91a8 100644 --- a/src/cyclic.c +++ b/src/cyclic.c @@ -1,7 +1,7 @@ #include "global.h" #include "cyclic.h" -RCSID("$Id: cyclic.c,v 1.3 1998/03/28 15:35:34 grubba Exp $"); +RCSID("$Id: cyclic.c,v 1.4 2000/05/07 00:39:17 hubbe Exp $"); #define CYCLIC_HASH_SIZE 4711 @@ -45,6 +45,7 @@ void *begin_cyclic(CYCLIC *c, void *b) { unsigned int h; + void *ret=0; CYCLIC *p; h=(int)id; @@ -58,8 +59,13 @@ void *begin_cyclic(CYCLIC *c, h%=CYCLIC_HASH_SIZE; for(p=cyclic_hash[h];p;p=p->next) + { if(a == p->a && b==p->b && id==p->id) - return p->ret; + { + ret=p->ret; + break; + } + } c->ret=(void *)1; c->a=a; @@ -69,5 +75,5 @@ void *begin_cyclic(CYCLIC *c, c->next=cyclic_hash[h]; cyclic_hash[h]=c; SET_ONERROR(c->onerr, low_unlink_cyclic, c); - return 0; + return ret; } diff --git a/src/las.c b/src/las.c index c5e13b16ffe47c4e4754de570eca4e57db961a98..464ba3c42efe9afb1d278a66b73c90891697a92c 100644 --- a/src/las.c +++ b/src/las.c @@ -5,7 +5,7 @@ \*/ /**/ #include "global.h" -RCSID("$Id: las.c,v 1.176 2000/05/01 02:11:25 hubbe Exp $"); +RCSID("$Id: las.c,v 1.177 2000/05/07 00:39:17 hubbe Exp $"); #include "language.h" #include "interpret.h" @@ -1230,14 +1230,16 @@ node *index_node(node *n, char *node_name, struct pike_string *id) default: { + int c; DECLARE_CYCLIC(); - if(BEGIN_CYCLIC(sp[-1].u.refs, id)) + c=(int)BEGIN_CYCLIC(sp[-1].u.refs, id); + if(c>1) { my_yyerror("Recursive module dependency in '%s'.",id->str); pop_stack(); push_int(0); }else{ - SET_CYCLIC_RET(1); + SET_CYCLIC_RET(c+1); ref_push_string(id); { struct svalue *save_sp = sp-2; @@ -1271,8 +1273,8 @@ node *index_node(node *n, char *node_name, struct pike_string *id) my_yyerror("Index '%s' not present in module.", id->str); } } - END_CYCLIC(); } + END_CYCLIC(); } } } diff --git a/src/opcodes.c b/src/opcodes.c index a933be50a243ad55be5df66873c74a99620c250f..d601094584d8241673333eede9bf36ea1367f1f5 100644 --- a/src/opcodes.c +++ b/src/opcodes.c @@ -26,7 +26,7 @@ #include "bignum.h" #include "operators.h" -RCSID("$Id: opcodes.c,v 1.74 2000/04/20 02:41:45 hubbe Exp $"); +RCSID("$Id: opcodes.c,v 1.75 2000/05/07 00:39:17 hubbe Exp $"); void index_no_free(struct svalue *to,struct svalue *what,struct svalue *ind) { @@ -502,8 +502,8 @@ void o_cast(struct pike_string *type, INT32 run_time_type) if(save_sp!=sp) fatal("o_cast left stack droppings.\n"); #endif - END_CYCLIC(); } + END_CYCLIC(); assign_svalue(sp-3,sp-1); pop_stack(); } @@ -550,8 +550,8 @@ void o_cast(struct pike_string *type, INT32 run_time_type) fatal("o_cast left stack droppings.\n"); #endif order_multiset(m); - END_CYCLIC(); } + END_CYCLIC(); assign_svalue(sp-3,sp-1); pop_stack(); } @@ -604,8 +604,8 @@ void o_cast(struct pike_string *type, INT32 run_time_type) if(save_sp!=sp) fatal("o_cast left stack droppings.\n"); #endif - END_CYCLIC(); } + END_CYCLIC(); assign_svalue(sp-4,sp-1); pop_stack(); } diff --git a/src/program.c b/src/program.c index 1806d40a8a71d88523163b32d9deb088f5887c6b..53a68da267bab60a0549ede2a590bc60c397d3aa 100644 --- a/src/program.c +++ b/src/program.c @@ -5,7 +5,7 @@ \*/ /**/ #include "global.h" -RCSID("$Id: program.c,v 1.235 2000/05/01 02:11:25 hubbe Exp $"); +RCSID("$Id: program.c,v 1.236 2000/05/07 00:39:17 hubbe Exp $"); #include "program.h" #include "object.h" #include "dynamic_buffer.h" @@ -451,8 +451,8 @@ struct node_s *find_module_identifier(struct pike_string *ident, } } pop_stack(); - END_CYCLIC(); } + END_CYCLIC(); if(ret) return ret; }