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

This commit is contained in:
Martin Whitaker 2021-01-03 12:56:04 +00:00
parent aae3a570c2
commit 9fa9a9d95a
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
@ -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...