Protect against infinite recursion in NetScope::find_class().

(cherry picked from commit 9fa9a9d95a)
This commit is contained in:
Martin Whitaker 2021-01-03 12:56:04 +00:00
parent d56efebbfe
commit 7866168cf7
1 changed files with 2 additions and 2 deletions

View File

@ -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
@ -732,7 +732,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...