Bugfix
Major
#27915
TL-Script function registry: StackOverflow for recursively calling functions
When analyzing whether a function is side-effect free, a stack overflow occurs with a recursive function:
at com.top_logic.model.search.expr.query.QueryExecutor.compileExpr(QueryExecutor.java:163) at com.top_logic.model.search.expr.query.QueryExecutor.compileExpr(QueryExecutor.java:149) at com.top_logic.model.search.expr.query.QueryExecutor.compileExpr(QueryExecutor.java:142) at com.top_logic.model.search.expr.query.QueryExecutor.compileExpr(QueryExecutor.java:135) at com.top_logic.model.search.configured.ConfiguredScript.computeHasSideEffects(ConfiguredScript.java:72) at com.top_logic.model.search.configured.ConfiguredScript.isSideEffectFree(ConfiguredScript.java:119) at com.top_logic.model.search.configured.QueryExecutorMethod.isSideEffectFree(QueryExecutorMethod.java:94) at com.top_logic.model.search.expr.compile.transform.HasSideEffects.visitGenericMethod(HasSideEffects.java:38) at com.top_logic.model.search.expr.compile.transform.HasSideEffects.visitGenericMethod(HasSideEffects.java:1) at com.top_logic.model.search.expr.GenericMethod.visit(GenericMethod.java:76) at com.top_logic.model.search.expr.visit.AbstractDescendingVisitor.descendPart(AbstractDescendingVisitor.java:87) at com.top_logic.model.search.expr.visit.DescendingVisitor.visitArithmetic(DescendingVisitor.java:590) at com.top_logic.model.search.expr.ArithmeticExpr.visit(ArithmeticExpr.java:167) at com.top_logic.model.search.expr.visit.AbstractDescendingVisitor.descendPart(AbstractDescendingVisitor.java:87) at com.top_logic.model.search.expr.visit.DescendingVisitor.visitIfElse(DescendingVisitor.java:170) at com.top_logic.model.search.expr.IfElse.visit(IfElse.java:90) at com.top_logic.model.search.expr.visit.AbstractDescendingVisitor.descendPart(AbstractDescendingVisitor.java:87) at com.top_logic.model.search.expr.visit.DescendingVisitor.visitIfElse(DescendingVisitor.java:170) at com.top_logic.model.search.expr.IfElse.visit(IfElse.java:90) at com.top_logic.model.search.expr.visit.AbstractDescendingVisitor.descendPart(AbstractDescendingVisitor.java:87) at com.top_logic.model.search.expr.visit.DescendingVisitor.visitLambda(DescendingVisitor.java:342) at com.top_logic.model.search.expr.Lambda.visit(Lambda.java:90) at com.top_logic.model.search.expr.compile.SearchExpressionCompiler.isSideEffectFree(SearchExpressionCompiler.java:134) at com.top_logic.model.search.expr.compile.SearchExpressionCompiler.compile(SearchExpressionCompiler.java:101) at com.top_logic.model.search.expr.query.QueryExecutor.compileExpr(QueryExecutor.java:163) at com.top_logic.model.search.expr.query.QueryExecutor.compileExpr(QueryExecutor.java:149) at com.top_logic.model.search.expr.query.QueryExecutor.compileExpr(QueryExecutor.java:142) at com.top_logic.model.search.expr.query.QueryExecutor.compileExpr(QueryExecutor.java:135) at com.top_logic.model.search.configured.ConfiguredScript.computeHasSideEffects(ConfiguredScript.java:72) at com.top_logic.model.search.configured.ConfiguredScript.isSideEffectFree(ConfiguredScript.java:119) at com.top_logic.model.search.configured.QueryExecutorMethod.isSideEffectFree(QueryExecutorMethod.java:94) at com.top_logic.model.search.expr.compile.transform.HasSideEffects.visitGenericMethod(HasSideEffects.java:38)
Test
- /com.top_logic.demo/src/test/java/test/com/top_logic/demo/scripted/tlscript/TestDefineRecusiveFunction.script.xml