-
Bug
-
Resolution: Done
-
Major
-
1.4.0
-
None
Rules using an AT LINE location are correctly injected at the specified line. However, they are then wrongly injected at each successive line which lies within the trigger method. This is a regression introduced into the line location trigger injection code. The visitLine method fails to set a flag the first time the rule is successfully injected. Subsequent visitLine calls test the flag and because it has not been set continue to inject trigger code. The obvious result is that the rule gets called more times than it should. A more subtle problem occurs when the rule includes reference to local variables in scope at the original trigger point. The variable may no longer be in scope at the later trigger points and the local variable slot may be reused to store an object of a different type. This can cause bizarre errors to manifest when the local variable reference is evaluated in the rule.