pike.git / src / las.cmod

version» Context lines:

pike.git/src/las.cmod:1773:    }    }       switch(TYPEOF(Pike_sp[-1])) {    case T_FUNCTION:    if((p = program_from_function(Pike_sp-1))) {    push_object_type(0, p->id);    break;    } else {    /* Attempt to get the return type for the function. */ -  struct pike_type *a, *b; +  struct pike_type *a, *b = NULL;    struct call_state cs;    a = get_type_of_svalue(Pike_sp-1);    /* Note: check_splice_call() below eats a reference from a.    * Note: CALL_INHIBIT_WARNINGS is needed since we don't    * provide a function name (and we don't want    * warnings here anyway).    */    INIT_CALL_STATE(cs);    a = check_splice_call(NULL, a, &cs, mixed_type_string, NULL,    CALL_INHIBIT_WARNINGS); -  FREE_CALL_STATE(cs); +     if (a) { -  b = new_get_return_type(a, 0); +  b = new_get_return_type(a, &cs, 0);    free_type(a); -  +  } +  FREE_CALL_STATE(cs);    if (b) {    push_finished_type(b);    free_type(b);    break;    }    } -  } +     /* FALLTHRU */       default:    if (Pike_compiler->compiler_pass == COMPILER_PASS_FIRST) {    /* The type isn't fully known yet, so do an extra pass. */    struct compilation *c = THIS_COMPILATION;    c->flags |= COMPILER_NEED_EXTRA_PASS;    } else {    my_yyerror("Illegal program identifier: %O.", Pike_sp-1);    }
pike.git/src/las.cmod:3897:       free_node(efun_node);       /* NOTE: Temporarily convert the node into an argument list node    * for new_check_call(),    */    n->token = F_ARG_LIST;    f = debug_malloc_pass(new_check_call(efun_string, f, n, &cs, 0));    n->token = opcode;    if (f) { -  struct pike_type *ret = new_get_return_type(f, 0); +  struct pike_type *ret = new_get_return_type(f, &cs, 0);    free_type(f);    f = ret;    }       FREE_CALL_STATE(cs);       if (f && CAR(n)) {    /* Check that the returned type is compatible with the    * variable type.    */
pike.git/src/las.cmod:4137:   #ifdef PIKE_DEBUG    l_flag = save_l_flag;   #endif    copy_pike_type(n->type, mixed_type_string);       FREE_CALL_STATE(cs);    break;    }       if ((n->type = new_get_return_type(dmalloc_touch(struct pike_type *, f), -  0))) { +  &cs, 0))) {    /* Type/argument-check OK. */    debug_malloc_touch(n->type);       free_type(f);    if(n->token == F_AUTO_MAP)    {    int depth;    type_stack_mark();    push_finished_type(n->type);    for (depth = is_automap_arg_list(CDR(n)); depth > 0; depth--) {
pike.git/src/las.cmod:4424:    } else {    add_ref(sscanf_type = sscanf_type_string);    }    args = mknode(F_ARG_LIST, CAR(n), CDR(n));    add_ref(CAR(n));    if (CDR(n)) add_ref(CDR(n));    INIT_CALL_STATE(cs);    sscanf_type = new_check_call(sscanf_name, sscanf_type, args, &cs, 0);    free_node(args);    if (sscanf_type) { -  if (!(n->type = new_get_return_type(sscanf_type, 0))) { +  if (!(n->type = new_get_return_type(sscanf_type, &cs, 0))) {    struct pike_type *expected;    if ((expected = get_first_arg_type(sscanf_type, CALL_NOT_LAST_ARG))) {    yytype_report(REPORT_ERROR,    NULL, 0, expected,    NULL, 0, NULL,    0, "Too few arguments to sscanf (got %d).",    cs.argno);    free_type(expected);    } else {    /* Most likely not reached. */