pike.git / src / las.cmod

version» Context lines:

pike.git/src/las.cmod:4236:    }    push_type(PIKE_T_AUTO);    free_type( t );    t = pop_unfinished_type();    Pike_compiler->compiler_frame->current_return_type = t;    } else {    node *retval = CAR(n);    if (retval->token == F_COMMA_EXPR) {    retval = CDR(retval);    } -  if ((t != void_type_string) || -  (retval->token != F_CONSTANT) || -  !SAFE_IS_ZERO(&retval->u.sval)) { +  /* NB: Always allow F_RETURN(0) as it is automatically added +  * as an end-sentinel by the compiler regardless of the +  * type of the function. It is typically not reached, so +  * complaining about it is not useful. +  * +  * FIXME: Consider complaining about it if it is reached +  * by docode. +  */ +  if ((retval->token != F_CONSTANT) || !SAFE_IS_ZERO(&retval->u.sval)) {    check_node_type(CAR(n), t, "Wrong return type.");    }    }    }    if (CDR(n) && (CDR(n)->u.sval.u.integer == 2)) {    /* __yield__ */    copy_pike_type(n->type, mixed_type_string);    } else {    copy_pike_type(n->type, void_type_string);    }