Bug #5338 ยป Re_ [SaxonJS - Bug #5338] XX Compiler reports _Unknown accumulator NNNNN_ when an accumulator-before or -after call occurs in a global variable - 2022-02-25T22_22_27Z.eml

John Lumley, 2022-02-25 23:22

X-He-Spam-Score: -1.8
Return-Path: <>
Received: from ([])
by with LMTP id 8GQ8AJFWGWISbAAAJzdhvw
for <>; Fri, 25 Feb 2022 23:22:09 +0100
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on
X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DMARC_NONE,
SPF_NONE_IGNORE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no
* -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at
*, no trust
* [ listed in]
* -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1%
* [score: 0.0000]
* -2.0 SPF_NONE_IGNORE does not consider absent SPF
* records
* 2.0 SPF_NONE SPF record not found
* 0.1 DMARC_NONE DMARC record not found
* -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2)
* [ listed in]
* 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record
* -0.0 T_SCC_BODY_TEXT_LINE No description available.
X-Spam-Score: -1.8
Authentication-Results:; dmarc=none (p=none dis=none)
Authentication-Results:; spf=none
Authentication-Results:; dkim=none; dkim-atps=neutral
Received: from ( [])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by (Postfix) with ESMTPS id 83845843ED
for <>; Fri, 25 Feb 2022 23:22:08 +0100 (CET)
Received: from ([])
by :WBEOUT: with ESMTP
id NiySnlCXFMMMQNiyTnohct; Fri, 25 Feb 2022 15:22:05 -0700
X-CMAE-Analysis: v=2.4 cv=OKbiYQWB c=1 sm=1 tr=0 ts=6219568d
a=bheWAUFm1xGnSTQFbH9Kqg==:117 a=y4qXYDzFA0B1yIq0kuFFAg==:17
a=qq5aBCZhl-YA:10 a=IkcTkHD0fZMA:10 a=oGFeUVbbRNcA:10
a=Wq2cTIo8Kv62N_fk2RAA:9 a=QEXdDO2ut3YA:10
Received: from ([]
by with esmtpa (Exim 4.94.2)
(envelope-from <>)
id 1nNiyS-0000JH-02
for; Fri, 25 Feb 2022 22:22:04 +0000
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
From: John Lumley <>
Mime-Version: 1.0 (1.0)
Subject: Re: [SaxonJS - Bug #5338] XX Compiler reports "Unknown accumulator NNNNN" when an accumulator-before or -after call occurs in a global variable
Date: Fri, 25 Feb 2022 22:22:02 +0000
Message-Id: <>
References: <>
In-Reply-To: <>
To: Saxonica Developer Community <>
X-Mailer: iPad Mail (18H107)
X-Mailcore-Auth: 439400283
X-Mailcore-Domain: 1881035
X-CMAE-Envelope: MS4xfN673gUIHwhvDTEeHW6x6tEIJgT9TWmtRnarQhc/TzbnzgBBQSobDt+m4E+mcEqTlyMMqc5BqDKSO/xf5hosMksF1ZbnPIeYPQeURLco7FH7qYnChVeb

When writing the code for the XX compiler, there are so many corner cases (m=
any thousands of them?) that might need to be satisfied that it=E2=80=99s pr=
etty much impossible to cover them all. In this case during the XPath compil=
ing of global variables, rather than other declarations, such as templates, I=
neglected to add the tunnelled variable defining in-scope accumulators, hen=
ce the error.

Unfortunately none of the then XSLT test suite cases covered reference to an=
accumulator in a global variable=E2=80=A6. hence the failure. These cases h=
appen, but as Michael says, some of them are very rarely used in practice=E2=
=80=A6 That=E2=80=99s why reporting these to the Saxonica forum is so helpfu=

Sent from my iPad

> On 25 Feb 2022, at 22:03, Saxonica Developer Community <notifications@plan=
.io> wrote:
> Please keep reporting them! My commentary wasn't based on any thought no-o=
ne should be doing this, but more on thinking "why is it that no-one has fou=
nd this bug before? What are they doing that other people aren't doing?"