Matteo Bruni : d3dcompiler: Fix freeing function.
Alexandre Julliard
julliard at winehq.org
Fri Sep 28 11:39:04 CDT 2012
Module: wine
Branch: master
Commit: f10e0d4e9ed5d2f2ebe9773bd1f6e5d7ebd6cf26
URL: http://source.winehq.org/git/wine.git/?a=commit;h=f10e0d4e9ed5d2f2ebe9773bd1f6e5d7ebd6cf26
Author: Matteo Bruni <mbruni at codeweavers.com>
Date: Fri Sep 28 17:22:38 2012 +0200
d3dcompiler: Fix freeing function.
---
dlls/d3dcompiler_43/hlsl.y | 4 ++--
dlls/d3dcompiler_43/utils.c | 4 ----
2 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/dlls/d3dcompiler_43/hlsl.y b/dlls/d3dcompiler_43/hlsl.y
index f9a685a..d302fa1 100644
--- a/dlls/d3dcompiler_43/hlsl.y
+++ b/dlls/d3dcompiler_43/hlsl.y
@@ -2227,7 +2227,7 @@ static DWORD add_modifier(DWORD modifiers, DWORD mod, const struct YYLTYPE *loc)
struct bwriter_shader *parse_hlsl(enum shader_type type, DWORD major, DWORD minor,
const char *entrypoint, char **messages)
{
- struct hlsl_ir_function_decl *function;
+ struct hlsl_ir_function_decl *function, *next_function;
struct hlsl_scope *scope, *next_scope;
struct hlsl_type *hlsl_type, *next_type;
struct hlsl_ir_var *var, *next_var;
@@ -2284,7 +2284,7 @@ struct bwriter_shader *parse_hlsl(enum shader_type type, DWORD major, DWORD mino
d3dcompiler_free(hlsl_ctx.source_files);
TRACE("Freeing functions IR.\n");
- LIST_FOR_EACH_ENTRY(function, &hlsl_ctx.functions, struct hlsl_ir_function_decl, node.entry)
+ LIST_FOR_EACH_ENTRY_SAFE(function, next_function, &hlsl_ctx.functions, struct hlsl_ir_function_decl, node.entry)
free_function(function);
TRACE("Freeing variables.\n");
diff --git a/dlls/d3dcompiler_43/utils.c b/dlls/d3dcompiler_43/utils.c
index 9f91579..eca67c9 100644
--- a/dlls/d3dcompiler_43/utils.c
+++ b/dlls/d3dcompiler_43/utils.c
@@ -2369,12 +2369,8 @@ void free_instr(struct hlsl_ir_node *node)
void free_function(struct hlsl_ir_function_decl *func)
{
- struct hlsl_ir_var *param, *next_param;
-
d3dcompiler_free((void *)func->name);
d3dcompiler_free((void *)func->semantic);
- LIST_FOR_EACH_ENTRY_SAFE(param, next_param, func->parameters, struct hlsl_ir_var, node.entry)
- d3dcompiler_free(param);
d3dcompiler_free(func->parameters);
free_instr_list(func->body);
d3dcompiler_free(func);
More information about the wine-cvs
mailing list