Branch: Tag:

2009-06-17

2009-06-17 15:39:05 by Henrik Grubbström (Grubba) <grubba@grubba.org>

low_get_function_line() now knows about prototypes.
Fixes [bug 4855 (#4855)] ("Bad offset" when generating backtrace).

Rev: src/program.c:1.762

2:   || 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: program.c,v 1.761 2009/04/22 17:17:55 grubba Exp $ + || $Id: program.c,v 1.762 2009/06/17 15:39:05 grubba Exp $   */      #include "global.h"
6963:    if (o->prog) {    struct program *p;    struct identifier *id; +  struct pike_string *ret;    while (1) {    struct external_variable_context loc;    struct reference *idref = o->prog->identifier_references + fun;
6976:    fun = id->func.ext_ref.id + loc.inherit->identifier_level;    o = loc.o;    } -  if (IDENTIFIER_IS_PIKE_FUNCTION(id->identifier_flags)) +  if (IDENTIFIER_IS_PIKE_FUNCTION(id->identifier_flags) && +  (id->func.offset != -1))    return low_get_line (p->program + id->func.offset, p, linep); -  +  if ((ret = get_identifier_line(p, fun, linep))) { +  add_ref(ret); +  return ret; +  }    return low_get_program_line(o->prog, linep);    }    *linep = 0;