From e2b11e19f6af99fc7f9a1bcc9abc86728d535de4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Henrik=20Grubbstr=C3=B6m=20=28Grubba=29?=
 <grubba@grubba.org>
Date: Tue, 18 Aug 2009 15:57:16 +0200
Subject: [PATCH] Now uses the MasterCodec to decode the master object.

Rev: src/encode.c:1.291
---
 src/encode.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/encode.c b/src/encode.c
index ad35247f5e..527b23a2ae 100644
--- a/src/encode.c
+++ b/src/encode.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: encode.c,v 1.290 2009/08/17 13:55:06 grubba Exp $
+|| $Id: encode.c,v 1.291 2009/08/18 13:57:16 grubba Exp $
 */
 
 #include "global.h"
@@ -5220,6 +5220,9 @@ static void rec_restore_value(char **v, ptrdiff_t *l)
   }
 }
 
+/* Defined in builtin.cmod. */
+extern struct program *MasterCodec_program;
+
 /*! @decl mixed decode_value(string coded_value, void|Codec codec)
  *!
  *! Decode a value from the string @[coded_value].
@@ -5276,8 +5279,8 @@ void f_decode_value(INT32 args)
     case 1:
       codec = get_master();
       if (!codec) {
-	/* Use a dummy if there's no master around yet, to avoid checks. */
-	push_object (clone_object (null_program, 0));
+	/* The codec used for decoding the master program. */
+	push_object (clone_object (MasterCodec_program, 0));
 	args++;
 	codec = Pike_sp[-1].u.object;
       }
-- 
GitLab