Branch: Tag:

1998-01-25

1998-01-25 08:28:45 by Fredrik Hübinette (Hubbe) <hubbe@hubbe.net>

jumbopatch! (DEBUG_MALLOC + parent feature fix)

Rev: src/ChangeLog:1.130
Rev: src/acconfig.h:1.15
Rev: src/array.c:1.22
Rev: src/array.h:1.6
Rev: src/builtin_functions.c:1.62
Rev: src/builtin_functions.h:1.6
Rev: src/cpp.c:1.14
Rev: src/dmalloc.h:1.1
Rev: src/docode.c:1.25
Rev: src/dynamic_buffer.c:1.6
Rev: src/dynamic_buffer.h:1.4
Rev: src/error.c:1.10
Rev: src/error.h:1.9
Rev: src/fdlib.c:1.9
Rev: src/gc.c:1.27
Rev: src/global.h:1.13
Rev: src/interpret.c:1.61
Rev: src/language.yacc:1.54
Rev: src/las.c:1.43
Rev: src/las.h:1.11
Rev: src/lex.c:1.40
Rev: src/lex.h:1.9
Rev: src/main.c:1.35
Rev: src/main.h:1.4
Rev: src/mapping.c:1.27
Rev: src/mapping.h:1.7
Rev: src/module.c:1.7
Rev: src/modules/Image/colortable.c:1.36
Rev: src/modules/Image/encodings/gif.c:1.30
Rev: src/modules/Image/encodings/png.c:1.2
Rev: src/modules/Image/encodings/pnm.c:1.12
Rev: src/modules/Image/encodings/x.c:1.5
Rev: src/modules/Yp/yp.c:1.10
Rev: src/modules/files/efuns.c:1.44
Rev: src/modules/files/file.c:1.69
Rev: src/modules/files/socket.c:1.25
Rev: src/modules/files/socktest.pike:1.7
Rev: src/modules/spider/accesseddb.c:1.13
Rev: src/modules/spider/dumudp.c:1.32
Rev: src/modules/spider/spider.c:1.51
Rev: src/modules/system/system.c:1.39
Rev: src/multiset.c:1.9
Rev: src/object.c:1.33
Rev: src/peep.c:1.17
Rev: src/pike_memory.c:1.4
Rev: src/pike_memory.h:1.2
Rev: src/pike_types.c:1.29
Rev: src/pike_types.h:1.7
Rev: src/program.c:1.54
Rev: src/program.h:1.27
Rev: src/stralloc.c:1.24
Rev: src/stralloc.h:1.12
Rev: src/testsuite.in:1.68
Rev: src/threads.c:1.53

129:   %token F_SUB_EQ   %token F_TYPEOF   %token F_VAL_LVAL - %token F_VARARGS +    %token F_VOID_ID   %token F_WHILE   %token F_XOR_EQ
162:   /* This is the grammar definition of Pike. */      #include "global.h" - RCSID("$Id: language.yacc,v 1.53 1998/01/20 02:30:35 hubbe Exp $"); + RCSID("$Id: language.yacc,v 1.54 1998/01/25 08:25:08 hubbe Exp $");   #ifdef HAVE_MEMORY_H   #include <memory.h>   #endif
280:   %type <number> F_STATIC   %type <number> F_STRING_ID   %type <number> F_SWITCH - %type <number> F_VARARGS +    %type <number> F_VOID_ID   %type <number> F_WHILE   %type <number> arguments
345:   %type <n> unused2   %type <n> while   %type <n> optional_comma_expr + %type <n> low_program_ref   %%      all: program;
368:    | { $$=0; }    ;    - program_ref: string_constant + low_program_ref: string_constant    {    ref_push_string($1);    push_string($1);
377:       if(sp[-1].type != T_PROGRAM)    my_yyerror("Couldn't cast string \"%s\" to program",$1->str); +  $$=mksvaluenode(sp-1); +  pop_stack();    }    | idents    {    if(last_identifier)    { -  push_string(last_identifier); +  ref_push_string(last_identifier);    last_identifier->refs++;    }else{    push_constant_text("");    } -  +  $$=$1; +  } +  ;    -  resolv_constant($1); -  switch(sp[-1].type) + program_ref: low_program_ref    { -  case T_OBJECT: -  if(!sp[-1].u.object->prog) -  { -  pop_stack(); -  push_int(0); -  }else{ -  struct program *p=sp[-1].u.object->prog; -  p->refs++; -  pop_stack(); -  push_program(p); +  resolv_program($1);    } -  break; -  -  case T_FUNCTION: -  if(program_from_function(sp-1)) -  break; -  -  default: -  yyerror("Illegal program identifier"); -  pop_stack(); -  push_int(0); -  -  case T_PROGRAM: -  break; -  } -  -  free_node($1); -  } +     ;    - inheritance: modifiers F_INHERIT program_ref optional_rename_inherit ';' + inheritance: modifiers F_INHERIT low_program_ref optional_rename_inherit ';'    {    if(!(new_program->flags & PROGRAM_PASS_1_DONE))    { -  struct pike_string *s=sp[-2].u.string; +  struct pike_string *s=sp[-1].u.string;    if($4) s=$4; -  do_inherit(sp-1,$1,s); +  compiler_do_inherit($3,$1,s);    }    if($4) free_string($4); -  pop_n_elems(2); +  pop_n_elems(1); +  free_node($3);    }    ;   
544:    for(; e>=0; e--)    {    push_finished_type(compiler_frame->variable[e].type); -  if($1 & ID_VARARGS) -  { -  push_type(T_VOID); -  push_type(T_OR); +     } -  } +     push_type(T_FUNCTION);       $<string>$=pop_type();
644:    | F_STATIC { $$ = ID_STATIC; }    | F_PRIVATE { $$ = ID_PRIVATE; }    | F_PUBLIC { $$ = ID_PUBLIC; } -  | F_VARARGS { $$ = ID_VARARGS; } +     | F_PROTECTED { $$ = ID_PROTECTED; } -  | F_INLINE { $$ = ID_INLINE | ID_NOMASK; } +  | F_INLINE { $$ = ID_INLINE; }    ;    - modifiers: modifier_list { $$=current_modifiers=$1; } ; + modifiers: modifier_list { $$=current_modifiers=$1 | lex.pragmas; } ;      modifier_list: /* empty */ { $$ = 0; }    | modifier modifier_list { $$ = $1 | $2; }
892:       fix_comp_stack($<number>2);    +  +  $4=mknode(F_ARG_LIST,$4,mknode(F_RETURN,mkintnode(0),0)); +  type=find_return_type($4); +  +  if(type) +  push_finished_type(type); +  else    push_type(T_MIXED);       e=$3-1;
919:    name=make_shared_string(buf);       f=dooptcode(name, -  mknode(F_ARG_LIST,$4,mknode(F_RETURN,mkintnode(0),0)), +  $4,    type,    ID_PRIVATE);    }
1506:    return e;    return -1;   } +  + void cleanup_compiler(void) + { +  if(last_identifier) +  { +  free_string(last_identifier); +  last_identifier=0; +  } + }