aboutsummaryrefslogtreecommitdiffstats
path: root/frontends/ast/dpicall.cc
diff options
context:
space:
mode:
authorHenner Zeller <h.zeller@acm.org>2021-01-21 12:20:53 -0800
committerHenner Zeller <h.zeller@acm.org>2021-01-21 12:20:53 -0800
commit7d014902ec579eccd04446131fea4772dd715daf (patch)
tree34b3359575d2bebdf0a3124153b3e3bd67a23d5d /frontends/ast/dpicall.cc
parent1f88a3de74eae3896e39795fd5a12d885ab29a93 (diff)
downloadyosys-7d014902ec579eccd04446131fea4772dd715daf.tar.gz
yosys-7d014902ec579eccd04446131fea4772dd715daf.tar.bz2
yosys-7d014902ec579eccd04446131fea4772dd715daf.zip
Fix digit-formatting calculation for small numbers.
Calling log10() on zero causes a non-sensical value to be calculated. On some compile options, I've observed yosys crashing with an illegal instruction (SIGILL). To make it safe, fix the calculation to do a range check; wrap it a decimal_digits() function, and use it where the previous ceil(log10(n)) call was used. As a side, it also improves readability. Signed-off-by: Henner Zeller <h.zeller@acm.org>
Diffstat (limited to 'frontends/ast/dpicall.cc')
0 files changed, 0 insertions, 0 deletions