pike.git / src / las.c

version» Context lines:

pike.git/src/las.c:1:   /*\   ||| This file is part of Pike. For copyright information see COPYRIGHT.   ||| Pike is distributed as GPL (General Public License)   ||| See the files COPYING and DISCLAIMER for more information.   \*/   /**/   #include "global.h" - RCSID("$Id: las.c,v 1.287 2002/05/12 00:27:46 mast Exp $"); + RCSID("$Id: las.c,v 1.288 2002/05/14 16:08:46 grubba Exp $");      #include "language.h"   #include "interpret.h"   #include "las.h"   #include "array.h"   #include "object.h"   #include "stralloc.h"   #include "dynamic_buffer.h"   #include "lex.h"   #include "pike_types.h"
pike.git/src/las.c:3766:    /* The expression gets the type from the variable. */    /* FIXME: Ought to strip non-applicable subtypes from the type. */    copy_pike_type(n->type, CAR(n)->type);    } else {    copy_pike_type(n->type, mixed_type_string);    }    break;       case F_RETURN:    if (!CAR(n) || (CAR(n)->type == void_type_string)) { -  yywarning("Returning a void expression."); -  if (!CAR(n)) { +  yywarning("Returning a void expression. Converted to zero.");   #ifdef SHARED_NODES    sub_node(n);   #endif /* SHARED_NODES */ -  +  if (!CAR(n)) {    _CAR(n) = mkintnode(0);    copy_pike_type(n->type, CAR(n)->type); -  +  } else { +  _CAR(n) = mknode(F_COMMA_EXPR, CAR(n), mkintnode(0)); +  copy_pike_type(n->type, CDAR(n)->type); +  }   #ifdef SHARED_NODES    if (!(n->tree_info & OPT_NOT_SHARED)) {    n->hash = hash_node(n);    }    n->node_info |= OPT_DEFROSTED;    add_node(n);   #endif /* SHARED_NODES */    break; -  } +     } else if(Pike_compiler->compiler_frame &&    Pike_compiler->compiler_frame->current_return_type) {    if (!pike_types_le(CAR(n)->type,    Pike_compiler->compiler_frame->current_return_type) &&    !(    Pike_compiler->compiler_frame->current_return_type==void_type_string &&    CAR(n)->token == F_CONSTANT &&    SAFE_IS_ZERO(& CAR(n)->u.sval)    )    ) {