From d4b33edbd0332addd616a0ba51ce6574c9b83b4f Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 9 Jun 2010 17:19:10 -0700 Subject: [PATCH] ir_constant_visitor: Use clone to create a constant from a variable reference --- ir_constant_expression.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ir_constant_expression.cpp b/ir_constant_expression.cpp index 96dfc56e31c..022692b9c92 100644 --- a/ir_constant_expression.cpp +++ b/ir_constant_expression.cpp @@ -550,7 +550,7 @@ ir_constant_visitor::visit(ir_dereference_variable *ir) ir_variable *var = ir->variable_referenced(); if (var && var->constant_value) - value = new ir_constant(ir->type, &var->constant_value->value); + value = var->constant_value->clone(); } -- 2.30.2