From: Luke Kenneth Casson Leighton Date: Wed, 11 May 2022 10:17:16 +0000 (+0100) Subject: stop possibility of infinite recursion in stages which X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bccd4af1ff4259cbe92f0a3b663ca67c09dc645e;p=nmutil.git stop possibility of infinite recursion in stages which set "stage = self" --- diff --git a/src/nmutil/stageapi.py b/src/nmutil/stageapi.py index 01fc568..a34dc7e 100644 --- a/src/nmutil/stageapi.py +++ b/src/nmutil/stageapi.py @@ -197,7 +197,8 @@ class StageHelper(Stage): def setup(self, m, i): if self.stage is not None and hasattr(self.stage, "setup"): - self.stage.setup(m, i) + if self.stage is not self: # stop infinite recursion + self.stage.setup(m, i) def _postprocess(self, i): # XXX DISABLED return i # RETURNS INPUT