From 387d18d2228dd7aa270463989fd366c99a9fc1c0 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. --- synth2.cc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/synth2.cc b/synth2.cc index b8cbf64c8..fa79a6eac 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 @@ -310,6 +310,15 @@ bool NetAssignBase::synth_async(Design*des, NetScope*scope, NexusSet&nex_map, NetBus&nex_out, NetBus&enables, vector&bitmasks) { + 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 ) { @@ -338,6 +347,7 @@ bool NetAssignBase::synth_async(Design*des, NetScope*scope, return flag; } + assert(rval_); NetNet*rsig = rval_->synthesize(des, scope, rval_); assert(rsig);