Branch: Tag:

2008-07-22

2008-07-22 23:35:13 by Martin Stjernholm <mast@lysator.liu.se>

Avoid exit-with-longjmp fatal in the compiler if the lexer fails to parse a
bignum.

Rev: src/lexer.h:1.85
Rev: src/stralloc.c:1.231
Rev: src/stralloc.h:1.110

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: stralloc.c,v 1.230 2008/07/18 01:42:49 mast Exp $ + || $Id: stralloc.c,v 1.231 2008/07/22 23:35:12 mast Exp $   */      #include "global.h"
3184:    return ret;   }    + int safe_wide_string_to_svalue_inumber(struct svalue *r, +  void * str, +  void *ptr, +  int base, +  ptrdiff_t maxlength, +  int shift) + /* For use from the lexer where we can't let errors be thrown. */ + { +  PCHARP tmp; +  JMP_BUF recovery; +  int ret = 0; +  +  free_svalue (&throw_value); +  mark_free_svalue (&throw_value); +  +  if (SETJMP (recovery)) { +  /* We know that pcharp_to_svalue_inumber has initialized the +  * svalue before any error might be thrown. */ +  call_handle_error(); +  ret = 0; +  } +  else +  ret = pcharp_to_svalue_inumber(r, +  MKPCHARP(str,shift), +  &tmp, +  base, +  maxlength); +  UNSETJMP (recovery); +  if(ptr) *(p_wchar0 **)ptr=tmp.ptr; +  return ret; + } +    PMOD_EXPORT int pcharp_to_svalue_inumber(struct svalue *r,    PCHARP str,    PCHARP *ptr,