Skip to content

Commit a7bf36c

Browse files
authored
Merge pull request #792 from diffblue/low1-fix
Verilog: zero_extend now considers genvar
2 parents 9bd2294 + 6fa56eb commit a7bf36c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
KNOWNBUG
1+
CORE broken-smt-backend
22
low1.sv
33
--module main --bound 0
44
^EXIT=0$
55
^SIGNAL=0$
66
--
77
^warning: ignoring
88
--
9-
This yields an error in the typechecker.

src/verilog/verilog_typecheck_expr.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -2351,8 +2351,9 @@ Function: zero_extend
23512351

23522352
static exprt zero_extend(const exprt &expr, const typet &type)
23532353
{
2354-
auto old_width = expr.type().id() == ID_bool
2355-
? 1
2354+
auto old_width = expr.type().id() == ID_bool ? 1
2355+
: expr.type().id() == ID_integer
2356+
? 32
23562357
: to_bitvector_type(expr.type()).get_width();
23572358

23582359
// first make unsigned

0 commit comments

Comments
 (0)