Skip to content

Commit a55de5b

Browse files
committed
Fix crashes on assignment to dummies
1 parent c200464 commit a55de5b

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/procedural.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,9 @@ void ProceduralContext::update_variable_state(slang::SourceLocation loc, Variabl
201201
seen_nonblocking_assignment[chunk.variable] = loc;
202202
}
203203
}
204+
} else if (chunk.variable.kind == Variable::Dummy) {
205+
// Dummies are for graceful error handling and require
206+
// no checking of blocking or nonblocking case
204207
} else {
205208
// This is expected to be an AST invariant -- we don't have a symbol
206209
// to use here for the ast_invariant() helper, so it's a plain

src/slang_frontend.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,9 @@ RTLIL::SigSpec VariableState::evaluate(NetlistContext &netlist, VariableBits vbi
429429
{
430430
RTLIL::SigSpec ret;
431431
for (auto vbit : vbits) {
432-
if (visible_assignments.count(vbit)) {
432+
if (vbit.variable.kind == Variable::Dummy) {
433+
ret.append(RTLIL::Sx);
434+
} else if (visible_assignments.count(vbit)) {
433435
ret.append(visible_assignments.at(vbit));
434436
} else {
435437
log_assert(vbit.variable.kind == Variable::Static);

0 commit comments

Comments
 (0)