From: Eddie Hung Date: Mon, 4 May 2020 19:18:20 +0000 (-0700) Subject: ast: swap range regardless of range_left >= 0 X-Git-Tag: working-ls180~557^2~1 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e936ac61ea223ca27c1b6eaf195cac66dd255602;p=yosys.git ast: swap range regardless of range_left >= 0 --- diff --git a/frontends/ast/simplify.cc b/frontends/ast/simplify.cc index 837c14ad7..cdb7e91e0 100644 --- a/frontends/ast/simplify.cc +++ b/frontends/ast/simplify.cc @@ -1079,7 +1079,7 @@ bool AstNode::simplify(bool const_fold, bool at_zero, bool in_lvalue, int stage, } if (old_range_valid != range_valid) did_something = true; - if (range_valid && range_left >= 0 && range_right > range_left) { + if (range_valid && range_right > range_left) { int tmp = range_right; range_right = range_left; range_left = tmp;