Branch: Tag:

1999-12-19

1999-12-19 15:52:32 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Improved decoding of object types.

Rev: src/encode.c:1.52

25:   #include "version.h"   #include "bignum.h"    - RCSID("$Id: encode.c,v 1.51 1999/12/11 01:14:56 grubba Exp $"); + RCSID("$Id: encode.c,v 1.52 1999/12/19 15:52:32 grubba Exp $");      /* #define ENCODE_DEBUG */   
891:    push_type_int(sp[-1].u.program->id);    break;    +  case T_FUNCTION: +  { +  struct program *prog; +  if (sp[-1].subtype == FUNCTION_BUILTIN) { +  error("Failed to decode object type.\n"); +  } +  prog = program_from_svalue(sp-1); +  if (!prog) { +  error("Failed to decode object type.\n"); +  } +  push_type_int(prog->id); +  } +  break; +     default:    error("Failed to decode type "    "(object(%s), expected object(zero|program)).\n",