[PATCH] jscript: functions that return -1 should have signed return (Coverity)

Jacek Caban jacek at codeweavers.com
Mon Jan 2 04:49:46 CST 2012


Hi Marcus,

On 12/31/11 15:43, Marcus Meissner wrote:
> Hi,
>
> Side issue of CID 5504.
>
> Ciao, Marcus
> ---
>   dlls/jscript/compile.c |    4 ++--
>   1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/dlls/jscript/compile.c b/dlls/jscript/compile.c
> index 60b0c2e..96497b6 100644
> --- a/dlls/jscript/compile.c
> +++ b/dlls/jscript/compile.c
> @@ -146,7 +146,7 @@ static BSTR compiler_alloc_bstr(compiler_ctx_t *ctx, const WCHAR *str)
>       return ctx->code->bstr_pool[ctx->code->bstr_cnt++];
>   }
>
> -static unsigned push_instr(compiler_ctx_t *ctx, jsop_t op)
> +static int push_instr(compiler_ctx_t *ctx, jsop_t op)
>   {
>       assert(ctx->code_size>= ctx->code_off);
>
> @@ -328,7 +328,7 @@ static HRESULT compile_member_expression(compiler_ctx_t *ctx, member_expression_
>
>   #define LABEL_FLAG 0x80000000
>
> -static unsigned alloc_label(compiler_ctx_t *ctx)
> +static int alloc_label(compiler_ctx_t *ctx)
>   {
>       if(!ctx->labels_size) {
>           ctx->labels = heap_alloc(8 * sizeof(*ctx->labels));

This patch just moves the problem around by introducing a lot of int to 
unsigned int assignments. Introducing something like 
INVALID_HANDLE_VALUE would solve the problem here, but I've sent more 
widespread changes that will fix this problem as well.

Thanks,
     Jacek



More information about the wine-devel mailing list