From 267ba427a3c98a5bbc6b66ab770fbba648d5918c Mon Sep 17 00:00:00 2001 From: Martin Whitaker Date: Mon, 27 Aug 2012 23:18:10 +0100 Subject: [PATCH] Fix for pr3561350. When a new NetEBMult object is created, the compiler guesses the expression width based on the sum of the operand widths. When we duplicate an expression, we need to override this with the width from the original expression. --- net_expr.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net_expr.cc b/net_expr.cc index 1dc1c3cb1..317e1147e 100644 --- a/net_expr.cc +++ b/net_expr.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2010 Stephen Williams (steve@icarus.com) + * Copyright (c) 2002-2012 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -274,6 +274,7 @@ NetEBMult* NetEBMult::dup_expr() const { NetEBMult*result = new NetEBMult(op_, left_->dup_expr(), right_->dup_expr()); + result->expr_width(expr_width()); return result; }