pike.git / src / builtin.cmod

version» Context lines:

pike.git/src/builtin.cmod:1:   /* -*- c -*-   || 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.103 2003/02/01 15:37:22 mast Exp $ + || $Id: builtin.cmod,v 1.104 2003/02/24 21:44:30 mast Exp $   */      #include "global.h"   #include "interpret.h"   #include "svalue.h"   #include "opcodes.h"   #include "pike_macros.h"   #include "object.h"   #include "program.h"   #include "array.h"
pike.git/src/builtin.cmod:1244:   };      /*! @endclass    */      /*! @endmodule    */      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;       for (f = i->frame_pointer; f; f = f->next) {    size++;    }       res = allocate_array_no_init(size, 0);    push_array(res);
pike.git/src/builtin.cmod:1297:    bf->fun.type = PIKE_T_FUNCTION;    function = ID_FROM_INT(f->current_object->prog, f->fun);    } else {    bf->fun.u.integer = 0;    bf->fun.subtype = NUMBER_DESTRUCTED;    bf->fun.type = PIKE_T_INT;    }       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) {    /* f->num_args can be too large, so this is necessary for some    * reason. I don't know why. /mast */    numargs = DO_NOT_WARN((INT32)MINIMUM(f->num_args,of->locals - f->locals));    }       numargs = MAXIMUM(numargs, 0);       /* 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;    }       if (numargs + varargs) {    bf->args = allocate_array_no_init(numargs + varargs, 0);    assign_svalues_no_free(bf->args->item, f->locals, numargs, BIT_MIXED);    if (varargs) {    assign_svalues_no_free(bf->args->item + numargs,    f->locals[numargs].u.array->item,