Project

Profile

Help

Revision 04f344fe

Added by Michael Kay over 12 years ago

fix bug 2798649 - Tail-recursive updating functions

View differences:

latest9.1/bj/net/sf/saxon/query/XQueryFunction.java
459 459
        // mark tail calls within the function body
460 460

  
461 461
        int arity = arguments.size();
462
        int tailCalls = ExpressionTool.markTailFunctionCalls(body, functionName, arity);
463
        if (tailCalls != 0) {
464
            compiledFunction.setBody(body);
465
            compiledFunction.setTailRecursive(tailCalls > 0, tailCalls > 1);
466
            body = new TailCallLoop(compiledFunction);
462
        if (!isUpdating) {
463
            int tailCalls = ExpressionTool.markTailFunctionCalls(body, functionName, arity);
464
            if (tailCalls != 0) {
465
                compiledFunction.setBody(body);
466
                compiledFunction.setTailRecursive(tailCalls > 0, tailCalls > 1);
467
                body = new TailCallLoop(compiledFunction);
468
            }
467 469
        }
468 470

  
469 471
        body.setContainer(this);

Also available in: Unified diff