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 under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: las.c,v 1.417 2008/06/02 13:30:05 mast Exp $ + || $Id: las.c,v 1.418 2008/06/26 11:43:23 grubba Exp $   */      #include "global.h"   #include "interpret.h"   #include "las.h"   #include "array.h"   #include "object.h"   #include "stralloc.h"   #include "dynamic_buffer.h"   #include "lex.h"
pike.git/src/las.c:3483:    } else {    struct pike_type *f; /* Expected type. */    struct pike_type *s; /* Actual type */    struct pike_string *name = NULL;   #ifndef NEW_ARG_CHECK    char *alternate_name = NULL;   #endif    int old_refs;    INT32 max_args,args;    -  if (!match_types(CAR(n)->type, function_type_string) && -  !match_types(CAR(n)->type, array_type_string)) { -  yytype_report(REPORT_ERROR, NULL, 0, function_type_string, -  NULL, 0, CAR(n)->type, -  0, "Calling non function value."); -  copy_pike_type(n->type, mixed_type_string); -  -  /* print_tree(n); */ -  break; -  } -  +    #ifdef NEW_ARG_CHECK       args = 0;       name = get_name_of_function(CAR(n));       /* NOTE: new_check_call() steals a reference from f! */    copy_pike_type(f, CAR(n)->type);    f = debug_malloc_pass(new_check_call(name, f, CDR(n), &args, 0));   
pike.git/src/las.c:3548: Inside #if defined(NEW_ARG_CHECK)
   } else {    yytype_report(REPORT_ERROR, NULL, 0, function_type_string,    NULL, 0, f,    0, "Attempt to call a non function value %S.",    name);    }    free_type(f);    break;   #else /* !NEW_ARG_CHECK */    +  if (!match_types(CAR(n)->type, function_type_string) && +  !match_types(CAR(n)->type, array_type_string)) { +  yytype_report(REPORT_ERROR, NULL, 0, function_type_string, +  NULL, 0, CAR(n)->type, +  0, "Calling non function value."); +  copy_pike_type(n->type, mixed_type_string); +  +  /* print_tree(n); */ +  break; +  } +     push_type(T_MIXED); /* match any return type */    push_type(T_VOID); /* even void */    push_type(T_OR);       push_type(T_VOID); /* not varargs */    push_type(T_MANY);    function_type_max=0;    low_build_function_type(CDR(n));    s = pop_type();    f = CAR(n)->type?CAR(n)->type:mixed_type_string;