Branch: Tag:

2008-07-14

2008-07-14 21:44:25 by Henrik Grubbström (Grubba) <grubba@grubba.org>

check_tailrecursion() now knows about scoped functions.

Rev: src/las.c:1.428

2:   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: las.c,v 1.427 2008/07/13 14:43:28 grubba Exp $ + || $Id: las.c,v 1.428 2008/07/14 21:44:25 grubba Exp $   */      #include "global.h"
359:   int check_tailrecursion(void)   {    int e; +  if (Pike_compiler->compiler_frame->lexical_scope & SCOPE_SCOPE_USED)) { +  /* There might be a lambda around that has references to the old context +  * in which case we can't reuse it with a tail-recursive call. +  */ +  return 0; +  }    if(debug_options & NO_TAILRECURSION) return 0;    for(e=0;e<Pike_compiler->compiler_frame->max_number_of_locals;e++)    {
3953:    break;       case F_CONSTANT: -  n->type = get_type_of_svalue(& n->u.sval); +  n->type = get_type_of_svalue(&n->u.sval);    break;       case F_FOREACH: