From 76a1aa6fa33856fce58741ac1018c27cfa756379 Mon Sep 17 00:00:00 2001 From: Martin Whitaker Date: Sun, 9 Feb 2020 18:40:03 +0000 Subject: [PATCH] Fix segfault when calling nex_input() for deassign and release statements. --- net_nex_input.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/net_nex_input.cc b/net_nex_input.cc index 3e37b7b95..d4e2b61a0 100644 --- a/net_nex_input.cc +++ b/net_nex_input.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 @@ -261,7 +261,8 @@ NexusSet* NetAssign_::nex_input(bool rem_out) NexusSet* NetAssignBase::nex_input(bool rem_out) { - NexusSet*result = rval_->nex_input(rem_out); + // For the deassign and release statements there is no R-value. + NexusSet*result = rval_ ? rval_->nex_input(rem_out) : new NexusSet; /* It is possible that the lval_ can have nex_input values. In particular, index expressions are statement inputs as well,