Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
H
Hdlmake
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
15
Issues
15
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Hdlmake
Commits
775fa2c0
Commit
775fa2c0
authored
Apr 26, 2016
by
Will Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add circlar reference detection to eliminate potential for infinite recursive loop.
parent
0b3a0a14
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
dep_file.py
hdlmake/dep_file.py
+5
-0
No files found.
hdlmake/dep_file.py
View file @
775fa2c0
...
...
@@ -197,7 +197,12 @@ class DepFile(File):
if
self
.
dep_level
==
None
:
if
len
(
self
.
depends_on
)
==
0
:
self
.
dep_level
=
0
elif
self
.
dep_level
>=
1000000
:
raise
Exception
(
"Probably run into a circular reference of file dependencies."
)
else
:
# set stupidly large value so can detect if the recusion below brings us back to
# this file in a circular reference, that would otherwise result in an infinite loop.
self
.
dep_level
=
1000000
# recurse, to find the largest number of levels below.
self
.
dep_level
=
1
+
max
([
dep
.
get_dep_level
()
for
dep
in
self
.
depends_on
]);
return
self
.
dep_level
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment