From 8889886efdf2ac9faf2d4224a64f46fafdc22348 Mon Sep 17 00:00:00 2001 From: Purdea Andrei Date: Sat, 11 Jul 2020 03:54:27 +0300 Subject: [PATCH] Add assert to protect against potentially dereferencing null pointer. Assert is apropriate, since it's not expected that the returned value is NULL in this case. --- elaborate.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/elaborate.cc b/elaborate.cc index 01d26e25d..09757adfd 100644 --- a/elaborate.cc +++ b/elaborate.cc @@ -5362,6 +5362,7 @@ NetProc* PReturn::elaborate(Design*des, NetScope*scope) const } NetNet*res = target->find_signal(target->basename()); + ivl_assert(*this, res); ivl_variable_type_t lv_type = res->data_type(); unsigned long wid = res->vector_width(); NetAssign_*lv = new NetAssign_(res);