Skip to content

Commit 08069e4

Browse files
committed
Always set the value to 0 for bit<0>/int<0> constants
Signed-off-by: Vladimír Štill <[email protected]>
1 parent 03137df commit 08069e4

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

ir/expression.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ void IR::Constant::handleOverflow(bool noWarning) {
9494
P4::warning(ErrorType::WARN_OVERFLOW,
9595
"%1%: zero-width integer cannot have non-zero value", this);
9696
}
97+
value = 0;
9798
} else if (tb->isSigned) {
9899
big_int max = (one << (width - 1)) - 1;
99100
big_int min = -(one << (width - 1));

0 commit comments

Comments
 (0)