From b9fe0b6c8541941735a8f067859de71ca2d30236 Mon Sep 17 00:00:00 2001 From: Sei Lisa Date: Mon, 19 Nov 2018 21:15:52 +0100 Subject: [PATCH] Add TODO item about side-effect analysis of UDFs --- lslopt/lslfoldconst.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lslopt/lslfoldconst.py b/lslopt/lslfoldconst.py index 4052ce1..624b0aa 100644 --- a/lslopt/lslfoldconst.py +++ b/lslopt/lslfoldconst.py @@ -1530,6 +1530,13 @@ class foldconst(object): return if nt == 'FNDEF': + # FIXME: Fix SEFness of UDFs + # A return statement does have side effects for the current + # function, as removing it would change its behaviour drastically. + # However, when seen from the outside, that does not make the + # function as a whole have side effects: if all nodes except + # return statements are SEF, the function is SEF. + # CurEvent is needed when folding llDetected* function calls if hasattr(node, 'scope'): # function definition