Branch: Tag:

2001-07-13

2001-07-13 11:26:40 by Henrik Grubbström (Grubba) <grubba@grubba.org>

get_{program_,}line() now returns a pike_string.
store_linenumber() is now wide string safe.
Added some more debug to store_linenumber().
Fixes [bug 1866 (#1866)].

Rev: src/builtin.cmod:1.59
Rev: src/builtin_functions.c:1.394
Rev: src/gc.c:1.169
Rev: src/interpret.c:1.219
Rev: src/interpreter.h:1.68
Rev: src/object.c:1.179
Rev: src/opcodes.c:1.113
Rev: src/program.c:1.353
Rev: src/program.h:1.138

30:      #include "block_alloc.h"    - RCSID("$Id: gc.c,v 1.168 2001/07/11 11:24:00 mast Exp $"); + RCSID("$Id: gc.c,v 1.169 2001/07/13 11:26:38 grubba Exp $");      /* Run garbage collect approximately every time    * 20 percent of all arrays, objects and programs is
785:       case T_PROGRAM:    { -  char *tmp; +  struct pike_string *tmp;    INT32 line;    int foo=0;   
797:    {    fprintf(stderr,"%*s**The program was written in C.\n",indent,"");    } -  tmp=get_program_line(p, &line); -  if(strcmp(tmp, "-")) +  +  tmp = get_program_line(p, &line); +  if(strcmp(tmp->str, "-"))    { -  fprintf(stderr,"%*s**Location: %s:%ld\n",indent,"",tmp,(long)line); +  fprintf(stderr,"%*s**Location: %s:%ld\n", +  indent, "", tmp->str, (long)line); +  free_string(tmp);    foo=1;    break;    } -  +  free_string(tmp);   #if 0    if(!foo && p->num_linenumbers>1 && EXTRACT_UCHAR(p->linenumbers)=='\177')    {
2600:    fprintf(stderr, "| Killing %p with %d refs", o, o->refs);    if (o->prog) {    INT32 line; -  char *file = get_program_line (o->prog, &line); -  fprintf(stderr, ", prog %s:%d\n", file, line); +  struct pike_string *file = get_program_line (o->prog, &line); +  fprintf(stderr, ", prog %s:%d\n", file->str, line); +  free_string(file);    }    else fputs(", is destructed\n", stderr);    );