From e5075c13404d8a7caae1c6d34c2c3138f57e4d17 Mon Sep 17 00:00:00 2001 From: Martin Whitaker Date: Sun, 9 Feb 2020 18:22:58 +0000 Subject: [PATCH] Fix GitHub issue #306 - segfault when synthesising deassign statement. Synthesis doesn't properly support any of the procedural continuous assignment statements, so output a "sorry" message and abort synthesis. (cherry picked from commit 387d18d2228dd7aa270463989fd366c99a9fc1c0) --- synth2.cc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/synth2.cc b/synth2.cc index da173a1c6..97cfa6735 100644 --- a/synth2.cc +++ b/synth2.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2016 Stephen Williams (steve@icarus.com) + * Copyright (c) 2002-2020 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -72,6 +72,15 @@ bool NetAssignBase::synth_async(Design*des, NetScope*scope, NexusSet&nex_map, NetBus&nex_out, NetBus&accumulated_nex_out) { + if (dynamic_cast(this) || dynamic_cast(this) || + dynamic_cast(this) || dynamic_cast(this)) { + cerr << get_fileline() << ": sorry: Procedural continuous " + "assignment is not currently supported in synthesis." + << endl; + des->errors += 1; + return false; + } + /* If the lval is a concatenation, synthesise each part separately. */ if (lval_->more ) { @@ -100,6 +109,7 @@ bool NetAssignBase::synth_async(Design*des, NetScope*scope, return flag; } + assert(rval_); NetNet*rsig = rval_->synthesize(des, scope, rval_); assert(rsig);