jscript: Fix parse_double_literal implementation

Alexandre Julliard julliard at winehq.org
Wed Jun 3 04:37:22 CDT 2009


Piotr Caban <piotr.caban at gmail.com> writes:

> @@ -382,13 +383,23 @@ static int parse_double_literal(parser_ctx_t *ctx, LONG int_part, literal_t **li
>      }
>  
>      d = int_part;
> -    while(ctx->ptr < ctx->end && isdigitW(*ctx->ptr))
> -        d = d*10 + *(ctx->ptr++) - '0';
> +    while(ctx->ptr < ctx->end && isdigitW(*ctx->ptr)) {
> +        hlp = d*10 + *(ctx->ptr++) - '0';
> +        if(d > LLONG_MAX/10 || hlp<0)
> +            exp++;
> +        else
> +            d = hlp;
> +    }

LLONG_MAX is not portable, you'll have to provide your own definition.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list