Is this a bug?

Saturday, 1 March 2014 · 3 messages · last reply 2 Mar 2014
RS
Rob Stapper1 Mar 2014 17:53 #
Hi, The enclosed example triggers stackoverflow-errror. I was wandering if it is a bug. The example should collect all ID-attribute-values of the containerElements, which are iterative-recursive. The $go($go, .) construction is inspired from Leo Wörtelers xq-modules: https://github.com/LeoWoerteler/xq-modules. Cheers, Rob Stapper --- Dit e-mailbericht bevat geen virussen en malware omdat avast! Antivirus-bescherming actief is. http://www.avast.com
LW
Leo Wörteler2 Mar 2014 13:34 #
Hi Rob,
Quoted text · Rob Stapper · 3 lines
Am 01.03.2014 17:53, schrieb Rob Stapper: > The enclosed example triggers stackoverflow-errror. > I was wandering if it is a bug.
yes, this definitely is a bug in the compiler. The function item $go is inlined even though it is (kind of) recursive, which leads to an infinite loop. I already have a fix for this lying around but I didn't finalize it yet because I didn't think you could produce these loops in XQuery. I raised an issue on GitHub [1] and will submit the fix as soon as possible. Thank you for reporting it!
Quoted text · Rob Stapper · 2 lines
> The $go($go, ….) construction is inspired from Leo Wörteler’s > xq-modules: “https://github.com/LeoWoerteler/xq-modules”.
Thanks for looking at those, I hope you like them! Leo [1] https://github.com/BaseXdb/basex/issues/879
LW
Leo Wörteler2 Mar 2014 15:55 #
Hi again Rob,
Quoted text · Leo Wörteler · 3 lines
Am 02.03.2014 13:34, schrieb Leo Wörteler: > I raised an issue on GitHub [1] and will submit the fix as soon as > possible. Thank you for reporting it!
Christian merged my pull request [2] and uploaded a new snapshot [3], could you try that and see if the problem is fixed? Cheers, Leo [1] https://github.com/BaseXdb/basex/issues/879 [2] https://github.com/BaseXdb/basex/pull/880 [3] http://files.basex.org/releases/latest/

⚡Generated with XQuery