Branch: Tag:

2002-05-09

2002-05-09 15:33:31 by Martin Stjernholm <mast@lysator.liu.se>

Fixed bug when programof returns a (program) function.

Rev: src/encode.c:1.142

26:   #include "bignum.h"   #include "pikecode.h"    - RCSID("$Id: encode.c,v 1.141 2002/05/02 16:32:13 mast Exp $"); + RCSID("$Id: encode.c,v 1.142 2002/05/09 15:33:31 mast Exp $");      /* #define ENCODE_DEBUG */   
2166:    case 0:    {    struct svalue *prog_code; +  struct program *p;       tmp=data->counter;    data->counter.u.integer++;
2181:    }else{    fallback_codec();    } -  if(data->pickyness && !program_from_svalue(Pike_sp-1)) { +  +  p = program_from_svalue(Pike_sp-1); +  +  if(data->pickyness && !p) {    if ((prog_code->type == T_STRING) &&    (prog_code->u.string->len < 128) &&    (!prog_code->u.string->size_shift)) {
2193:    /* Remove the extra entry from the stack. */    stack_swap();    pop_stack(); +  ref_push_program(p); +  stack_swap(); +  pop_stack();    break;    }    case 1: