Branch: Tag:

2003-02-24

2003-02-24 21:44:30 by Martin Stjernholm <mast@lysator.liu.se>

Fixed a bug in low_backtrace where the backtrace itself could be reported as
an argument to the top function if it was of varargs type.

Rev: src/builtin.cmod:1.125

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: builtin.cmod,v 1.124 2003/02/19 17:31:29 marcus Exp $ + || $Id: builtin.cmod,v 1.125 2003/02/24 21:44:30 mast Exp $   */      #include "global.h"
1412:      void low_backtrace(struct Pike_interpreter *i)   { +  struct svalue *stack_top = i->stack_pointer;    struct pike_frame *f, *of = 0;    int size = 0;    struct array *res = NULL;
1465:       if (f->locals) {    INT32 numargs = DO_NOT_WARN((INT32) MINIMUM(f->num_args, -  i->stack_pointer - f->locals)); +  stack_top - f->locals));    INT32 varargs = 0;       if(of) {
1478:       /* Handle varargs... */    if (function && (function->identifier_flags & IDENTIFIER_VARARGS) && -  (f->locals + numargs < i->stack_pointer) && +  (f->locals + numargs < stack_top) &&    (f->locals[numargs].type == T_ARRAY)) {    varargs = f->locals[numargs].u.array->size;    }