Actions
Bug #2107
closedByte code CannotCompileException for DoubleToInteger conversion
Start date:
2014-07-18
Due date:
% Done:
100%
Estimated time:
Legacy ID:
Applies to branch:
Fix Committed on Branch:
Fixed in Maintenance Release:
Platforms:
Description
Bug reported by Gunther Rademacher:
When showing some more XQuery code to Saxon-EE with byte code
generation, I came across a CannotCompileException. My attempt
to create a minimal reproduction resulted in this:
declare function local:f($done, $todo)
{
if (empty($todo)) then
$done
else
local:f
(
(
$done,
1 to xs:integer($todo[1]/@n + 1)
),
subsequence($todo, 2)
)
};
local:f
(
(),
(
<x n="1"/>,
<y n="2"/>
)
)
The stack trace is shown below.
com.saxonica.bytecode.util.CannotCompileException:
at com.saxonica.bytecode.converter.DoubleToIntegerCompiler.compileToPrimitive(DoubleToIntegerCompiler.java:49)
at com.saxonica.bytecode.CastExpressionCompiler.compileToPrimitive(CastExpressionCompiler.java:67)
at com.saxonica.bytecode.util.CompilerService.compileToPrimitive(CompilerService.java:794)
at com.saxonica.bytecode.RangeExpressionCompiler.compileToIterator(RangeExpressionCompiler.java:59)
at com.saxonica.bytecode.util.CompilerService.compileToIterator(CompilerService.java:716)
at com.saxonica.bytecode.LetExpressionCompiler.compileCommonExpr(LetExpressionCompiler.java:455)
at com.saxonica.bytecode.UserFunctionCallCompiler.compileFunctionCall(UserFunctionCallCompiler.java:68)
at com.saxonica.bytecode.UserFunctionCallCompiler.compileToIterator(UserFunctionCallCompiler.java:23)
at com.saxonica.bytecode.util.CompilerService.compileToIterator(CompilerService.java:716)
at com.saxonica.bytecode.ChooseCompiler.compileToIterator(ChooseCompiler.java:43)
at com.saxonica.bytecode.util.CompilerService.compileToIterator(CompilerService.java:716)
at com.saxonica.bytecode.TailCallLoopCompiler.compileToIterator(TailCallLoopCompiler.java:21)
at com.saxonica.bytecode.util.CompilerService.compileToIterator(CompilerService.java:716)
at com.saxonica.bytecode.util.CompilerService.compileToByteCode(CompilerService.java:491)
at com.saxonica.expr.ee.OptimizerEE.compileToByteCode(OptimizerEE.java:1363)
at net.sf.saxon.query.XQueryFunction.optimize(XQueryFunction.java:506)
at net.sf.saxon.query.XQueryFunctionLibrary.optimizeGlobalFunctions(XQueryFunctionLibrary.java:324)
at net.sf.saxon.query.QueryModule.optimizeGlobalFunctions(QueryModule.java:1123)
at net.sf.saxon.expr.instruct.Executable.fixupQueryModules(Executable.java:579)
at net.sf.saxon.query.QueryParser.makeXQueryExpression(QueryParser.java:169)
at net.sf.saxon.query.StaticQueryContext.compileQuery(StaticQueryContext.java:526)
at net.sf.saxon.Query.compileQuery(Query.java:702)
at net.sf.saxon.Query.doQuery(Query.java:332)
at net.sf.saxon.Query.main(Query.java:107)
Please register to edit this issue
Actions