Branch: Tag:

2000-05-07

2000-05-07 00:39:52 by Fredrik Hübinette (Hubbe) <hubbe@hubbe.net>

allow one cyclic recursion when resolving identifiers

Rev: lib/master.pike.in:1.117
Rev: src/builtin_functions.c:1.273
Rev: src/cyclic.c:1.4
Rev: src/las.c:1.177
Rev: src/opcodes.c:1.75
Rev: src/program.c:1.236

5:   \*/   /**/   #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:       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:    my_yyerror("Index '%s' not present in module.", id->str);    }    } +  }    END_CYCLIC();    }    }    } -  } +     UNSETJMP(tmp);    ret=mkconstantsvaluenode(sp-1);    pop_stack();