2001-03-18
2001-03-18 00:59:34 by Henrik Grubbström (Grubba) <grubba@grubba.org>
-
9e6f6f14de122124e7f0aaf64897c37d1421d8bb
(18 lines)
(+13/-5)
[
Show
| Annotate
]
Branch: 7.9
Fixed bug in decode_type().
Changed representation of USE_PIKE_TYPE T_ASSIGN nodes.
Added some more debug.
Added missing type_to_string().
Rev: src/encode.c:1.93
Rev: src/pike_types.c:1.163
Rev: src/pike_types.h:1.63
25:
#include "version.h"
#include "bignum.h"
- RCSID("$Id: encode.c,v 1.92 2001/03/17 16:37:42 grubba Exp $");
+ RCSID("$Id: encode.c,v 1.93 2001/03/18 00:59:33 grubba Exp $");
/* #define ENCODE_DEBUG */
289: Inside #if defined(USE_PIKE_TYPE)
goto one_more_type;
case T_ASSIGN:
- addchar((ptrdiff_t)t->car);
+ if (((ptrdiff_t)t->car < 0) || ((ptrdiff_t)t->car > 9)) {
+ fatal("Bad assign marker: %ld\n", (long)(ptrdiff_t)t->car);
+ }
+ addchar('0' + (ptrdiff_t)t->car);
t = t->cdr;
goto one_more_type;
1140:
switch(tmp)
{
default:
- fatal("error in type string (%d).\n", tmp);
+ Pike_error("decode_value(): Error in type string (%d).\n", tmp);
/*NOTREACHED*/
break;
case T_ASSIGN:
-
+ tmp = GETC();
+ if ((tmp < '0') || (tmp > '9')) {
+ Pike_error("decode_value(): Bad marker in type string (%d).\n", tmp);
+ }
#ifdef USE_PIKE_TYPE
low_decode_type(data);
- push_assign_type(GETC());
+ push_assign_type(tmp); /* Actually reverse, but they're the same */
break;
#else /* !USE_PIKE_TYPE */
-
+ push_type(T_ASSIGN);
push_type(tmp);
- push_type(GETC());
+
goto one_more_type;
#endif /* USE_PIKE_TYPE */