ast: simplify to fully populate dynamic slicing case transformation
authorEddie Hung <eddie@fpgeh.com>
Tue, 31 Mar 2020 18:52:14 +0000 (11:52 -0700)
committerEddie Hung <eddie@fpgeh.com>
Tue, 31 Mar 2020 18:52:14 +0000 (11:52 -0700)
frontends/ast/simplify.cc

index 04c02d893c9289ba796eb6da2c9e09942e0af544..073b9cbbe4907d7774a88cbf97c575518b2a0391 100644 (file)
@@ -1727,7 +1727,7 @@ bool AstNode::simplify(bool const_fold, bool at_zero, bool in_lvalue, int stage,
                }
                did_something = true;
                newNode = new AstNode(AST_CASE, shift_expr);
-               for (int i = 0; i <= source_width-result_width; i++) {
+               for (int i = 0; i < source_width; i++) {
                        int start_bit = children[0]->id2ast->range_right + i;
                        AstNode *cond = new AstNode(AST_COND, mkconst_int(start_bit, true));
                        AstNode *lvalue = children[0]->clone();