Branch: Tag:

2003-01-11

2003-01-11 01:52:55 by Martin Stjernholm <mast@lysator.liu.se>

Force init of bignum support after the master is loaded, to avoid that the
bignum code later throws loading errors in functions that are called from
places in the compiler where exceptions aren't handled. (It will still
happen if bignum literals are used in the master, though.)

Rev: src/bignum.c:1.28
Rev: src/bignum.h:1.18
Rev: src/main.c:1.164

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: bignum.c,v 1.27 2002/10/11 01:39:28 nilsson Exp $ + || $Id: bignum.c,v 1.28 2003/01/11 01:52:55 mast Exp $   */      #include "global.h"
27:   PMOD_EXPORT int gmp_library_loaded=0;   int gmp_library_resolving=0;    - static void resolve_auto_bignum_program(void) + void init_auto_bignum(void)   { -  if(auto_bignum_program.type == T_INT) -  { +     if(gmp_library_resolving)    Pike_fatal("Recursive GMP resolving!\n");   
46:    dmalloc_touch_svalue(sp);    gmp_library_resolving=0;    } - } +       PMOD_EXPORT struct program *get_auto_bignum_program(void)   { -  resolve_auto_bignum_program(); +     return program_from_function(&auto_bignum_program);   }      PMOD_EXPORT struct program *get_auto_bignum_program_or_zero(void)   { -  if(!gmp_library_loaded || -  gmp_library_resolving || -  !master_object) return 0; -  resolve_auto_bignum_program(); +  if (auto_bignum_program.type == T_INT) +  return 0;    return program_from_function(&auto_bignum_program);   }   
71:      PMOD_EXPORT void convert_stack_top_to_bignum(void)   { -  resolve_auto_bignum_program(); +     apply_svalue(&auto_bignum_program, 1);       if(sp[-1].type != T_OBJECT)
80:      PMOD_EXPORT void convert_stack_top_with_base_to_bignum(void)   { -  resolve_auto_bignum_program(); +     apply_svalue(&auto_bignum_program, 2);       if(sp[-1].type != T_OBJECT)
95:    * /Hubbe    */    -  if(!gmp_library_loaded || -  gmp_library_resolving || -  !master_object) +  if (auto_bignum_program.type == T_INT)    return 0; /* not possible */    -  resolve_auto_bignum_program(); +     return o->prog == program_from_svalue(&auto_bignum_program);   }   
160: Inside #if defined(INT64)
   neg = 1;    }    -  resolve_auto_bignum_program(); -  +    #if PIKE_BYTEORDER == 1234    {    char digits[8];