[PATCH 3/5] d3dcompiler: Fix "for" syntax.
Matteo Bruni
mbruni at codeweavers.com
Wed Oct 10 11:25:58 CDT 2012
No ';' after the last field...
---
dlls/d3dcompiler_43/hlsl.y | 11 +++++------
1 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/dlls/d3dcompiler_43/hlsl.y b/dlls/d3dcompiler_43/hlsl.y
index 8627e54..afb12ec 100644
--- a/dlls/d3dcompiler_43/hlsl.y
+++ b/dlls/d3dcompiler_43/hlsl.y
@@ -320,7 +320,7 @@ enum loop_type
};
static struct list *create_loop(enum loop_type type, struct list *init, struct list *cond,
- struct list *iter, struct list *body, struct source_location *loc)
+ struct hlsl_ir_node *iter, struct list *body, struct source_location *loc)
{
struct list *list = NULL;
struct hlsl_ir_loop *loop = NULL;
@@ -355,14 +355,13 @@ static struct list *create_loop(enum loop_type type, struct list *init, struct l
list_move_tail(loop->body, body);
if (iter)
- list_move_tail(loop->body, iter);
+ list_add_tail(loop->body, &iter->entry);
if (type == LOOP_DO_WHILE)
list_add_tail(loop->body, &cond_jump->node.entry);
d3dcompiler_free(init);
d3dcompiler_free(cond);
- d3dcompiler_free(iter);
d3dcompiler_free(body);
return list;
@@ -375,7 +374,7 @@ oom:
d3dcompiler_free(list);
free_instr_list(init);
free_instr_list(cond);
- free_instr_list(iter);
+ free_instr(iter);
free_instr_list(body);
return NULL;
}
@@ -1651,7 +1650,7 @@ loop_statement: KW_WHILE '(' expr ')' statement
set_location(&loc, &@1);
$$ = create_loop(LOOP_DO_WHILE, NULL, cond, NULL, $2, &loc);
}
- | KW_FOR '(' scope_start expr_statement expr_statement expr_statement ')' statement
+ | KW_FOR '(' scope_start expr_statement expr_statement expr ')' statement
{
struct source_location loc;
@@ -1659,7 +1658,7 @@ loop_statement: KW_WHILE '(' expr ')' statement
$$ = create_loop(LOOP_FOR, $4, $5, $6, $8, &loc);
pop_scope(&hlsl_ctx);
}
- | KW_FOR '(' scope_start declaration expr_statement expr_statement ')' statement
+ | KW_FOR '(' scope_start declaration expr_statement expr ')' statement
{
struct source_location loc;
--
1.7.8.6
More information about the wine-patches
mailing list