Actions
Bug #5786
closed

Stack overflow in ExpressionTool.expressionSize()
Start date:
2022-12-30
Due date:
% Done:
100%
Estimated time:
Legacy ID:
Applies to branch:
11, trunk
Fix Committed on Branch:
11, trunk
Description
A stack overflow (infinite recursion) occurs in ExpressionTool.expressionSize() if a function A contains as a subexpression a reference to a function B which itself contains a call on A. Example:
xquery version "3.1";
module namespace cmp = "http://www.w3.org/qt4cg/compare";
declare function cmp:compare($x as node(), $y as node()) as xs:boolean {
if ($x instance of document-node() and $y instance of document-node()) then
cmp:compare-content($x, $y)
else....
};
declare function cmp:compare-content($x as node(), $y as node()) as xs:boolean {
if (count($x/node()) ne count($y/node()))
then trace(false(), "different numbers of children")
else every $child-comparison in for-each-pair($x/node(), $y/node(), cmp:compare#2) satisfies $child-comparison
};
There's a comment pointing to bug #5054...
Updated by Michael Kay 11 months ago
- Status changed from New to Resolved
- Priority changed from Low to Normal
- Applies to branch 11, trunk added
- Fix Committed on Branch 11, trunk added
- Platforms .NET, Java added
Function references in a function no longer contribute to the size exception when the reference is to an anonymous function (because this indicates an inline function).
Updated by Community Admin 11 months ago
- % Done changed from 0 to 100
- Fixed in Maintenance Release 12.0 added
Bug issue fix applied in the Saxon 12.0 Major Release. Leaving this bug marked as Resolved until fix applied
Updated by O'Neil Delpratt 10 months ago
- Fixed in Maintenance Release 11.5 added
Bug applied in the Saxon 11.5 Maintenance release.
Please register to edit this issue
Actions