vbscript: Fix vanishing statements.

When adding multiple statements (e.g. colon separated SimpleStatements)
in function source_add_statement(), tail of linked list was not adjusted.

Signed-off-by: Robert Wilhelm <robert.wilhelm@gmx.net>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Robert Wilhelm 2020-09-22 22:14:29 +02:00 committed by Alexandre Julliard
parent 6946d78ed9
commit fe59d1a5d3
2 changed files with 8 additions and 0 deletions

View File

@ -516,12 +516,17 @@ static void source_add_statement(parser_ctx_t *ctx, statement_t *stat)
if(!stat)
return;
/* concatenate both linked lists */
if(ctx->stats) {
ctx->stats_tail->next = stat;
ctx->stats_tail = stat;
}else {
ctx->stats = ctx->stats_tail = stat;
}
/* find new tail */
while(ctx->stats_tail->next) {
ctx->stats_tail=ctx->stats_tail->next;
}
}
static void source_add_class(parser_ctx_t *ctx, class_decl_t *class_decl)

View File

@ -67,6 +67,9 @@ Call ok(W = 5, "W = " & W & " expected " & 5)
x = "xx"
Call ok(x = "xx", "x = " & x & " expected ""xx""")
Dim public1 : public1 = 42
Call ok(public1 = 42, "public1=" & public1 & " expected & " & 42)
Call ok(true <> false, "true <> false is false")
Call ok(not (true <> true), "true <> true is true")
Call ok(not ("x" <> "x"), """x"" <> ""x"" is true")