Branch: Tag:

2008-02-27

2008-02-27 10:23:18 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Backported fix for encoding bug for semi-large integers on 64-bit architectures from Pike 7.7.

Rev: src/encode.c:1.191

2:   || 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.190 2008/02/06 19:17:14 mast Exp $ + || $Id: encode.c,v 1.191 2008/02/27 10:23:18 grubba Exp $   */      #include "global.h"
32:   #include "opcodes.h"   #include "peep.h"    - RCSID("$Id: encode.c,v 1.190 2008/02/06 19:17:14 mast Exp $"); + RCSID("$Id: encode.c,v 1.191 2008/02/27 10:23:18 grubba Exp $");      /* #define ENCODE_DEBUG */   
556: Inside #if SIZEOF_INT_TYPE > 4
   if (i != (INT32)i)    {   #ifdef AUTO_BIGNUM +  /* Reuse the id. */ +  data->counter.u.integer--; +  /* Make sure we don't find ourselves again below... */ +  map_delete(data->encoded, val); +  +  /* Encode as a bignum */    push_int(i);    convert_stack_top_to_bignum();    encode_value2(Pike_sp-1,data, 0);    pop_stack(); -  +  +  /* Restore the entry we removed above. */ +  mapping_insert(data->encoded, val, &entry_id);   #else    Pike_error ("Cannot encode integers with more than 32 bits "    "without bignum support.\n");