diff --git a/src/builtin.cmod b/src/builtin.cmod
index 4035a86b4ab7271fa618f178e68d920dbc4026ce..720c1a343985153c0c52c0e2d18adcc45a58ad53 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 9ba3a8700d378ad4426be1727194d981ef217410..099cf448c4424309e1bf3e30dfd40a4c6130e3c6 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 04ae097a161d59972606f0b0d887ad708a236018..9184e893b1d7c296c7e95fafd5a58c4f4f3b1e33 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