Branch: Tag:

2004-03-12

2004-03-12 21:58:28 by Martin Stjernholm <mast@lysator.liu.se>

Separated the return address from Pike_fp->pc. pc always points to the
current opcode now, which makes everything a lot simpler. This fixes
off-by-one bugs that could occur for the innermost line in backtraces when
machine code is used.

Rev: src/builtin.cmod:1.108
Rev: src/interpret.h:1.124
Rev: src/interpret_functions.h:1.127

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.107 2003/07/28 14:47:38 mast Exp $ + || $Id: builtin.cmod,v 1.108 2004/03/12 21:58:28 mast Exp $   */      #include "global.h"
1280:       if ((bf->prog = f->context.prog)) {    add_ref(bf->prog); -  if (f->pc) { -  /* f->pc is the return address (i.e the next opcode) when -  * inside a call, otherwise it points to the current -  * opcode. */ -  if (of) -  bf->pc = f->pc - 1; -  else +     bf->pc = f->pc;    } -  } +        if ((bf->fun.u.object = f->current_object) &&    (bf->fun.u.object->prog)) {