Skip to content

Commit

Permalink
Verilog: zero_extend now considers genvar
Browse files Browse the repository at this point in the history
zero_extend now handles genvar-typed variables.
  • Loading branch information
kroening committed Oct 31, 2024
1 parent 6b0d346 commit 6fa56eb
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 6fa56eb

Please sign in to comment.