From 48a624cd888d06b058b11237394bddf82c698ea8 Mon Sep 17 00:00:00 2001 From: Martin Stjernholm <mast@lysator.liu.se> Date: Sat, 31 May 2003 03:14:27 +0200 Subject: [PATCH] Made function_program work for non-efun C functions. Rev: src/builtin.cmod:1.137 Rev: src/constants.c:1.48 Rev: src/constants.h:1.31 --- src/builtin.cmod | 8 +++++--- src/constants.c | 5 +++-- src/constants.h | 3 ++- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/builtin.cmod b/src/builtin.cmod index 4035a86b4a..720c1a3439 100644 --- a/src/builtin.cmod +++ b/src/builtin.cmod @@ -2,7 +2,7 @@ || 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.136 2003/05/15 15:33:30 mast Exp $ +|| $Id: builtin.cmod,v 1.137 2003/05/31 01:14:27 mast Exp $ */ #include "global.h" @@ -963,8 +963,10 @@ PIKEFUN program function_program(program|function func) case PIKE_T_FUNCTION: { struct program *p; - if(func->subtype == FUNCTION_BUILTIN) break; - p = func->u.object->prog; + if(func->subtype == FUNCTION_BUILTIN) + p = func->u.efun->prog; + else + p = func->u.object->prog; if(p == pike_trampoline_program) { p = ((struct pike_trampoline *)func->u.object->storage)-> diff --git a/src/constants.c b/src/constants.c index 9ba3a8700d..099cf448c4 100644 --- a/src/constants.c +++ b/src/constants.c @@ -2,7 +2,7 @@ || 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: constants.c,v 1.47 2003/04/02 19:22:42 mast Exp $ +|| $Id: constants.c,v 1.48 2003/05/31 01:14:27 mast Exp $ */ #include "global.h" @@ -18,7 +18,7 @@ #include "security.h" #include "block_alloc.h" -RCSID("$Id: constants.c,v 1.47 2003/04/02 19:22:42 mast Exp $"); +RCSID("$Id: constants.c,v 1.48 2003/05/31 01:14:27 mast Exp $"); struct mapping *builtin_constants = 0; @@ -84,6 +84,7 @@ PMOD_EXPORT struct callable *low_make_callable(c_fun fun, f->function=fun; f->name=name; f->type=type; + f->prog=Pike_compiler->new_program; f->flags=flags; f->docode=docode; f->optimize=optimize; diff --git a/src/constants.h b/src/constants.h index 04ae097a16..9184e893b1 100644 --- a/src/constants.h +++ b/src/constants.h @@ -2,7 +2,7 @@ || 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: constants.h,v 1.30 2003/04/02 19:22:42 mast Exp $ +|| $Id: constants.h,v 1.31 2003/05/31 01:14:27 mast Exp $ */ #ifndef ADD_EFUN_H @@ -24,6 +24,7 @@ struct callable c_fun function; struct pike_type *type; struct pike_string *name; + struct program *prog; INT16 flags; /* OPT_* */ INT16 internal_flags; #ifdef PIKE_DEBUG -- GitLab