diff options
author | Eric Anholt <eric@anholt.net> | 2010-06-24 15:13:03 -0700 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2010-06-24 15:13:03 -0700 |
commit | e33c10328caec29616a5433b1d1df9088f3a84df (patch) | |
tree | 723cc38803bb10032d28be9a9a161232d05d0fd1 /hir_field_selection.cpp | |
parent | 9290e0dd28e646c3dc810e0a6405582f8bf643b6 (diff) | |
parent | 26bbfb7917a71d46d9227bbf960606cb673636d3 (diff) |
Merge remote branch 'cworth/master'
Conflicts:
ast_to_hir.cpp
ir.cpp
This brings in the talloc-based memory management work, so that the
compiler (almost) no longer leaks memory.
Diffstat (limited to 'hir_field_selection.cpp')
-rw-r--r-- | hir_field_selection.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/hir_field_selection.cpp b/hir_field_selection.cpp index e60ea30d7f..e2efff60d3 100644 --- a/hir_field_selection.cpp +++ b/hir_field_selection.cpp @@ -33,6 +33,7 @@ _mesa_ast_field_selection_to_hir(const ast_expression *expr, exec_list *instructions, struct _mesa_glsl_parse_state *state) { + void *ctx = talloc_parent(state); ir_rvalue *result = NULL; ir_rvalue *op; @@ -62,8 +63,8 @@ _mesa_ast_field_selection_to_hir(const ast_expression *expr, expr->primary_expression.identifier); } } else if (op->type->base_type == GLSL_TYPE_STRUCT) { - result = new ir_dereference_record(op, - expr->primary_expression.identifier); + result = new(ctx) ir_dereference_record(op, + expr->primary_expression.identifier); if (result->type->is_error()) { _mesa_glsl_error(& loc, state, "Cannot access field `%s' of " @@ -76,5 +77,5 @@ _mesa_ast_field_selection_to_hir(const ast_expression *expr, expr->primary_expression.identifier); } - return result ? result : ir_call::get_error_instruction(); + return result ? result : ir_call::get_error_instruction(ctx); } |