Branch: Tag:

1999-04-15

1999-04-15 04:08:39 by Fredrik Hübinette (Hubbe) <hubbe@hubbe.net>

more debug

Rev: src/constants.c:1.17
Rev: src/constants.h:1.9
Rev: src/docode.c:1.46
Rev: src/dynamic_load.c:1.35
Rev: src/interpret.c:1.120
Rev: src/modules/Image/encodings/_xpm.c:1.5
Rev: src/modules/Image/encodings/pcx.c:1.5
Rev: src/modules/Image/encodings/tga.c:1.5
Rev: src/modules/Image/encodings/xbm.c:1.3
Rev: src/modules/Image/encodings/xcf.c:1.7
Rev: src/opcodes.c:1.37

5:   \*/   /**/   #include "global.h" - RCSID("$Id: interpret.c,v 1.119 1999/04/08 23:54:28 hubbe Exp $"); + RCSID("$Id: interpret.c,v 1.120 1999/04/15 04:08:14 hubbe Exp $");   #include "interpret.h"   #include "object.h"   #include "program.h"
694:    if(s->subtype == FUNCTION_BUILTIN)    {   #ifdef PIKE_DEBUG +  struct svalue *expected_stack = sp-args;    if(t_flag>1)    {    init_buf();
702:    }   #endif    (*(s->u.efun->function))(args); +  + #ifdef PIKE_DEBUG +  if(sp != expected_stack + !s->u.efun->may_return_void) +  { +  if(sp < expected_stack) +  fatal("Function popped too many arguments: %s\n", +  s->u.efun->name->str); +  if(sp>expected_stack+1) +  fatal("Function left droppings on stack: %s\n", +  s->u.efun->name->str); +  if(sp == expected_stack && !s->u.efun->may_return_void) +  fatal("Non-void function returned without return value on stack: %s %d\n", +  s->u.efun->name->str,s->u.efun->may_return_void); +  if(sp==expected_stack+1 && s->u.efun->may_return_void) +  fatal("Void function returned with a value on the stack: %s %d\n", +  s->u.efun->name->str, s->u.efun->may_return_void); +  } + #endif +     break;    }else{    o=s->u.object;