Skip to content

Commit

Permalink
Merge pull request #792 from diffblue/low1-fix
Browse files Browse the repository at this point in the history
Verilog: zero_extend now considers genvar
  • Loading branch information
tautschnig authored Oct 31, 2024
2 parents 9bd2294 + 6fa56eb commit a7bf36c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
3 changes: 1 addition & 2 deletions regression/verilog/system-functions/low1.desc
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
KNOWNBUG
CORE broken-smt-backend
low1.sv
--module main --bound 0
^EXIT=0$
^SIGNAL=0$
--
^warning: ignoring
--
This yields an error in the typechecker.
5 changes: 3 additions & 2 deletions src/verilog/verilog_typecheck_expr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2351,8 +2351,9 @@ Function: zero_extend

static exprt zero_extend(const exprt &expr, const typet &type)
{
auto old_width = expr.type().id() == ID_bool
? 1
auto old_width = expr.type().id() == ID_bool ? 1
: expr.type().id() == ID_integer
? 32
: to_bitvector_type(expr.type()).get_width();

// first make unsigned
Expand Down

0 comments on commit a7bf36c

Please sign in to comment.