From 9fa9a9d95a0c040c71b6a756d3ff059518c5929f Mon Sep 17 00:00:00 2001 From: Martin Whitaker Date: Sun, 3 Jan 2021 12:56:04 +0000 Subject: [PATCH] Protect against infinite recursion in NetScope::find_class(). --- net_scope.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net_scope.cc b/net_scope.cc index a25b16a81..5940edbdf 100644 --- a/net_scope.cc +++ b/net_scope.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2020 Stephen Williams (steve@icarus.com) + * Copyright (c) 2000-2021 Stephen Williams (steve@icarus.com) * Copyright (c) 2016 CERN Michele Castellana (michele.castellana@cern.ch) * * This source code is free software; you can redistribute it @@ -740,7 +740,7 @@ netclass_t*NetScope::find_class(const Design*des, perm_string name) return up_->find_class(des, name); // Try the compilation unit. - if (unit_ != 0) + if (unit_ != 0 && this != unit_) return unit_->find_class(des, name); // Nowhere left to try...