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

1:   /* -*- c -*- -  * $Id: builtin.cmod,v 1.58 2001/07/11 17:57:23 mast Exp $ +  * $Id: builtin.cmod,v 1.59 2001/07/13 11:26:37 grubba Exp $    */      #include "global.h"
407:   {    if(p && p->num_linenumbers)    { -  char *tmp; +     INT32 line; -  if((tmp=get_program_line(p, &line))) -  { -  struct pike_string *tmp2; -  tmp2=make_shared_string(tmp); +  struct pike_string *tmp = get_program_line(p, &line); +     pop_n_elems(args);    -  push_string(tmp2); +  push_string(tmp);    if(line >= 1)    {    push_constant_text(":");
424:    }    return;    } -  } +        pop_n_elems(args);    push_int(0);
802:    push_text("backtrace_frame(");    if (THIS->pc) {    if (!THIS->filename) { -  THIS->filename = -  make_shared_string(get_line(THIS->pc, THIS->prog, &THIS->lineno)); +  THIS->filename = get_line(THIS->pc, THIS->prog, &THIS->lineno);    }    THIS->pc = NULL;    }
903:    case 1: /* Linenumber */    if (THIS->pc) {    if (!THIS->filename) { -  THIS->filename = -  make_shared_string(get_line(THIS->pc, THIS->prog, -  &THIS->lineno)); +  THIS->filename = get_line(THIS->pc, THIS->prog, &THIS->lineno);    }    THIS->pc = NULL;    }
979:    /* First make sure we have line-number info. */    if (THIS->pc) {    if (!THIS->filename) { -  THIS->filename = -  make_shared_string(get_line(THIS->pc, THIS->prog, -  &THIS->lineno)); +  THIS->filename = get_line(THIS->pc, THIS->prog, &THIS->lineno);    }    THIS->pc = NULL;    }
1721:    copy_shared_string(THIS->to, to = to_->u.string);       if (del->len) { -  THIS->mojt = compile_memsearcher(MKPCHARP_STR(del), -  del->len, -  0x7fffffff, -  del); +  THIS->mojt = simple_compile_memsearcher(del);    }    }