[PATCH 17/19] vbscript: Added support for exit do statement

Octavian Voicu octavian.voicu at gmail.com
Sun Sep 18 06:48:01 CDT 2011


On Fri, Sep 16, 2011 at 2:30 PM, Jacek Caban <jacek at codeweavers.com> wrote:
> --- a/dlls/vbscript/compile.c
> +++ b/dlls/vbscript/compile.c
>  static HRESULT compile_while_statement(compile_ctx_t *ctx, while_statement_t *stat)
>  {
> -    unsigned start_addr;
> +    unsigned start_addr, prev_label;
...
> +    if(stat->stat.type != STAT_WHILE) {
> +        prev_label = ctx->while_end_label;
> +        if((ctx->while_end_label = alloc_label(ctx)) == -1)
> +            return E_OUTOFMEMORY;
> +    }
...
> +    if(stat->stat.type != STAT_WHILE) {
> +        label_set_addr(ctx, ctx->while_end_label);
> +        ctx->while_end_label = prev_label;
> +    }

Hello,

This patch introduces a compile warning (gcc 4.5.2, both x86 and amd64):
../compile.c:489:26: warning: ‘prev_label’ may be used uninitialized
in this function

While I can see there's no actual problem, how can we shut the
compiler's mouth? It may even be the case that if we just put a
prev_label = 0 initializer, static analyzers will start complaining
it's a useless assignment.

Octavian



More information about the wine-devel mailing list