ir_constant_visitor: Use clone to create a constant from a variable reference
authorIan Romanick <ian.d.romanick@intel.com>
Thu, 10 Jun 2010 00:19:10 +0000 (17:19 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Fri, 11 Jun 2010 20:51:42 +0000 (13:51 -0700)
ir_constant_expression.cpp

index 96dfc56e31c92a6c47f6b9268de02d2bd499269b..022692b9c927477773c12211d1e83b8e978b9d41 100644 (file)
@@ -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();
 }