When global variables are defined in several XQuery
modules, the algorithm for allocating slot numbers
(i.e. for allocating space for the values of the
variables) may assign two variables to the same slot.
This can result in corruption of the values of the
variables, or in a spurious message indicating that the
definition of one of the variables is circular.
Source code fixed, test case added (qxmp140)