mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-24 01:25:33 +00:00
fmt: fuzz, remove some unnecessary busywork
Removing some signed checks and logic where we've already guaranteed the values to be positive. Indeed, in these cases, if a negative value got through (per my realisation in the signed fuzz harness), it would cause an infinite loop due to flooring division.
This commit is contained in:
parent
2ae551c0af
commit
3571bf2c2d
4 changed files with 55 additions and 20 deletions
|
@ -905,10 +905,7 @@ std::ostream &operator<<(std::ostream &os, const value_formatted<Bits> &vf)
|
|||
buf += '0';
|
||||
while (!val.is_zero()) {
|
||||
value<Bits> quotient;
|
||||
if (negative)
|
||||
val.signedDivideWithRemainder(value<Bits>{10u}, quotient);
|
||||
else
|
||||
val.divideWithRemainder(value<Bits>{10u}, quotient);
|
||||
val.divideWithRemainder(value<Bits>{10u}, quotient);
|
||||
buf += '0' + val.template slice<3, 0>().val().template get<uint8_t>();
|
||||
val = quotient;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue