pike.git / src / las.c

version» Context lines:

pike.git/src/las.c:1:   /*\   ||| This file a part of Pike, and is copyright by Fredrik Hubinette   ||| 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.139 1999/12/14 00:23:42 grubba Exp $"); + RCSID("$Id: las.c,v 1.140 1999/12/14 00:45:51 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:184:    }   }      struct pike_string *find_return_type(node *n)   {    struct pike_string *a,*b;       check_tree(n,0);       if(!n) return 0; +  +  if (n->token == F_RETURN) { +  if (CAR(n)) { +  if (CAR(n)->type) { +  copy_shared_string(a, CAR(n)->type); +  } else { + #ifdef PIKE_DEBUG +  if (l_flag > 2) { +  fprintf(stderr, "Return with untyped argument.\n"); +  print_tree(n); +  } + #endif /* PIKE_DEBUG */ +  copy_shared_string(a, mixed_type_string); +  } +  } else { +  copy_shared_string(a, zero_type_string); +  } +  return a; +  } +     if(!(n->tree_info & OPT_RETURN)) return 0; -  +     if(car_is_node(n))    a=find_return_type(CAR(n));    else    a=0;       if(cdr_is_node(n))    b=find_return_type(CDR(n));    else    b=0;       if(a)    { -  if(b && a!=b) return or_pike_types(a, b, 1); -  add_ref(a); +  if(b && a!=b) { +  struct pike_string *res = or_pike_types(a, b, 1); +  free_string(a); +  free_string(b); +  return res; +  }    return a;    } -  if (b) { -  add_ref(b); +     return b;   } -  return 0; - } +          #define NODES 256      #undef BLOCK_ALLOC_NEXT   #define BLOCK_ALLOC_NEXT u.node.a      BLOCK_ALLOC(node_s, NODES);      #undef BLOCK_ALLOC_NEXT