=================================================================== RCS file: /home/cvs/OpenXM_contrib2/asir2000/parse/eval.c,v retrieving revision 1.58 retrieving revision 1.62 diff -u -p -r1.58 -r1.62 --- OpenXM_contrib2/asir2000/parse/eval.c 2005/12/11 05:27:30 1.58 +++ OpenXM_contrib2/asir2000/parse/eval.c 2007/12/20 03:31:01 1.62 @@ -45,13 +45,16 @@ * DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, * PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. * - * $OpenXM: OpenXM_contrib2/asir2000/parse/eval.c,v 1.57 2005/12/10 14:14:15 noro Exp $ + * $OpenXM: OpenXM_contrib2/asir2000/parse/eval.c,v 1.61 2007/11/15 06:24:59 ohara Exp $ */ #include #include "ca.h" #include "al.h" #include "base.h" #include "parse.h" +#if defined(GC7) +#include "gc.h" +#endif #include #include #if defined(PARI) @@ -59,11 +62,14 @@ #endif extern JMP_BUF timer_env; +extern FUNC cur_binf; +extern NODE PVSS; int f_break,f_return,f_continue; int evalstatline; int recv_intr; int show_crossref; +int at_root; void gen_searchf_searchonly(char *name,FUNC *r); LIST eval_arg(FNODE a,unsigned int quote); @@ -551,7 +557,7 @@ FNODE partial_eval(FNODE f) case I_FUNC: a1 = partial_eval((FNODE)FA1(f)); func = (FUNC)FA0(f); - if ( func->id == A_UNDEF ) { + if ( func->id == A_UNDEF || func->id != A_USR ) { a1 = mkfnode(2,I_FUNC,func,a1); return a1; } else { @@ -721,6 +727,7 @@ pointer evalstat(SNODE f) bp(f); } evalstatline = f->ln; + if ( !PVSS ) at_root = evalstatline; switch ( f->id ) { case S_BP: @@ -834,8 +841,6 @@ pointer evalnode(NODE node) return ( val ); } -extern FUNC cur_binf; -extern NODE PVSS; LIST eval_arg(FNODE a,unsigned int quote) { @@ -936,8 +941,15 @@ pointer evalf(FUNC f,FNODE a,FNODE opt) getrlimit(RLIMIT_STACK,&rl); stack_size = rl.rlim_cur; } - if ( !stack_base ) - stack_base = (void *)GC_get_stack_base(); + if ( !stack_base ) { +#if defined(GC7) + struct GC_stack_base sb; + GC_get_stack_base(&sb); + stack_base = (void *)sb.mem_base; +#else + stack_base = (void *)GC_get_stack_base(); +#endif + } if ( (stack_base - (void *)&args) +0x100000 > stack_size ) error("stack overflow"); #endif