Actions
Bug #5786
closed![Author: Michael Kay](https://www.gravatar.com/avatar/db6526d63053f09b62e52c2da8b2230a?rating=PG&size=50&default=https%3A%2F%2Fassets.plan.io%2Fimages%2Fdefault_avatar.png)
![Assignee: Michael Kay](https://www.gravatar.com/avatar/db6526d63053f09b62e52c2da8b2230a?rating=PG&size=22&default=https%3A%2F%2Fassets.plan.io%2Fimages%2Fdefault_avatar.png)
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...
Please register to edit this issue
Actions