vbscript: Always initialize prev_label to prevent compiler warning.

Octavian Voicu octavian.voicu at gmail.com
Mon Sep 19 12:31:58 CDT 2011


--
Although the code was tehnically correct, gcc still complained that
prev_label might have been used uninitialized.
---
 dlls/vbscript/compile.c |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/dlls/vbscript/compile.c b/dlls/vbscript/compile.c
index 60e4935..17d0ea3 100644
--- a/dlls/vbscript/compile.c
+++ b/dlls/vbscript/compile.c
@@ -500,11 +500,9 @@ static HRESULT compile_while_statement(compile_ctx_t *ctx, while_statement_t *st
     if(jmp_end == -1)
         return E_OUTOFMEMORY;
 
-    if(stat->stat.type != STAT_WHILE) {
-        prev_label = ctx->while_end_label;
-        if((ctx->while_end_label = alloc_label(ctx)) == -1)
-            return E_OUTOFMEMORY;
-    }
+    prev_label = ctx->while_end_label;
+    if(stat->stat.type != STAT_WHILE && (ctx->while_end_label = alloc_label(ctx)) == -1)
+        return E_OUTOFMEMORY;
 
     hres = compile_statement(ctx, stat->body);
     if(FAILED(hres))
-- 
1.7.4.1




More information about the wine-patches mailing list