From 76a9bded86c26aa860aa2d2093061935da33611c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Henrik=20Grubbstr=C3=B6m=20=28Grubba=29?=
 <grubba@grubba.org>
Date: Fri, 5 Jan 2007 16:49:47 +0100
Subject: [PATCH] Don't attempt to encode programs that haven't been fixated.
 Fixes fatal "Unknown identifier type.".

Rev: src/encode.c:1.239
---
 src/encode.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/encode.c b/src/encode.c
index 9dd7a36411..ee2e4d69a4 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.238 2006/10/27 18:43:15 grubba Exp $
+|| $Id: encode.c,v 1.239 2007/01/05 15:49:47 grubba Exp $
 */
 
 #include "global.h"
@@ -975,6 +975,8 @@ static void encode_value2(struct svalue *val, struct encode_data *data, int forc
       }
       if (data->canonic)
 	Pike_error("Canonical encoding of programs not supported.\n");
+      if (!(val->u.program->flags & PROGRAM_FIXED))
+	Pike_error("Encoding of unfixated programs not supported.\n");
       check_stack(1);
       push_svalue(val);
       apply(data->codec,"nameof", 1);
@@ -1518,7 +1520,9 @@ static void encode_value2(struct svalue *val, struct encode_data *data, int forc
 
 		default:;
 #ifdef PIKE_DEBUG
-		  Pike_fatal ("Unknown identifier type.\n");
+		  Pike_fatal ("Unknown identifier type: 0x%04x for symbol \"%s\".\n",
+			      id->identifier_flags & IDENTIFIER_TYPE_MASK,
+			      id->name->str);
 #endif
 		}
 	      }
-- 
GitLab