[latex3-commits] [git/LaTeX3-latex3-latex2e] develop: Reset Lua(TeX) allocators to zero inside conditionals (fixes #363) (5c3b071b)

Joseph Wright joseph.wright at morningstar2.co.uk
Mon Aug 3 11:43:21 CEST 2020


Repository : https://github.com/latex3/latex2e
On branch  : develop
Link       : https://github.com/latex3/latex2e/commit/5c3b071bdddfe9edb87f59857d8c69fa059378c7

>---------------------------------------------------------------

commit 5c3b071bdddfe9edb87f59857d8c69fa059378c7
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Mon Aug 3 10:43:21 2020 +0100

    Reset Lua(TeX) allocators to zero inside conditionals (fixes #363)


>---------------------------------------------------------------

5c3b071bdddfe9edb87f59857d8c69fa059378c7
 base/changes.txt  |  5 +++++
 base/ltluatex.dtx | 18 +++++++++++-------
 2 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/base/changes.txt b/base/changes.txt
index f23b31ff..6978eb7d 100644
--- a/base/changes.txt
+++ b/base/changes.txt
@@ -7,6 +7,11 @@ completeness or accuracy and it contains some references to files that
 are not part of the distribution.
 ================================================================================
 
+2020-08-03  Joseph Wright <joseph.wright at latex-project.org>
+
+	* ltluatex.dtx:
+	Correct resetting of allocation counters. (gh/363)
+
 2020-08-01  Marcel Krüger     <Marcel.Krueger at latex-project.org>
 
 	* fontdef.dtx, inputenc.dtx, ltfinal.dtx, ltluatex.dtx:
diff --git a/base/ltluatex.dtx b/base/ltluatex.dtx
index 1cda2931..369672da 100644
--- a/base/ltluatex.dtx
+++ b/base/ltluatex.dtx
@@ -28,7 +28,7 @@
 \ProvidesFile{ltluatex.dtx}
 %</driver>
 %<*tex>
-[2020/08/01 v1.1p
+[2020/08/03 v1.1q
 %</tex>
 %<plain>  LuaTeX support for plain TeX (core)
 %<*tex>
@@ -550,18 +550,19 @@
 %
 % \begin{macro}{\newattribute}
 % \changes{v1.0a}{2015/09/24}{Macro added}
+% \changes{v1.1q}{2020/08/02}{Move reset to $0$ inside conditional}
 %   As is generally the case for the Lua\TeX{} registers we start here
 %   from~$1$. Notably, some code assumes that |\attribute0| is never used so
 %   this is important in this case.
 %    \begin{macrocode}
 \ifx\e at alloc@attribute at count\@undefined
   \countdef\e at alloc@attribute at count=258
+  \e at alloc@attribute at count=\z@
 \fi
 \def\newattribute#1{%
   \e at alloc\attribute\attributedef
     \e at alloc@attribute at count\m at ne\e at alloc@top#1%
 }
-\e at alloc@attribute at count=\z@
 %    \end{macrocode}
 % \end{macro}
 %
@@ -592,7 +593,6 @@
     \e at alloc@ccodetable at count\m at ne{"8000}#1%
   \initcatcodetable\allocationnumber
 }
-\e at alloc@ccodetable at count=\z@
 %    \end{macrocode}
 % \end{macro}
 %
@@ -699,18 +699,19 @@
 %
 % \begin{macro}{\newluafunction}
 % \changes{v1.0a}{2015/09/24}{Macro added}
+% \changes{v1.1q}{2020/08/02}{Move reset to $0$ inside conditional}
 %   Much the same story for allocating Lua\TeX{} functions except here they are
 %   just numbers so they are allocated in the same way as boxes.
 %   Lua indexes from~$1$ so once again slot~$0$ is skipped.
 %    \begin{macrocode}
 \ifx\e at alloc@luafunction at count\@undefined
   \countdef\e at alloc@luafunction at count=260
+  \e at alloc@luafunction at count=\z@
 \fi
 \def\newluafunction{%
   \e at alloc\luafunction\e at alloc@chardef
     \e at alloc@luafunction at count\m at ne\e at alloc@top
 }
-\e at alloc@luafunction at count=\z@
 %    \end{macrocode}
 % \end{macro}
 %
@@ -718,17 +719,18 @@
 %
 % \begin{macro}{\newwhatsit}
 % \changes{v1.0a}{2015/09/24}{Macro added}
+% \changes{v1.1q}{2020/08/02}{Move reset to $0$ inside conditional}
 %   These are only settable from Lua but for consistency are definable
 %   here.
 %    \begin{macrocode}
 \ifx\e at alloc@whatsit at count\@undefined
   \countdef\e at alloc@whatsit at count=261
+  \e at alloc@whatsit at count=\z@
 \fi
 \def\newwhatsit#1{%
   \e at alloc\whatsit\e at alloc@chardef
     \e at alloc@whatsit at count\m at ne\e at alloc@top#1%
 }
-\e at alloc@whatsit at count=\z@
 %    \end{macrocode}
 % \end{macro}
 %
@@ -736,17 +738,18 @@
 %
 % \begin{macro}{\newluabytecode}
 % \changes{v1.0a}{2015/09/24}{Macro added}
+% \changes{v1.1q}{2020/08/02}{Move reset to $0$ inside conditional}
 %   These are only settable from Lua but for consistency are definable
 %   here.
 %    \begin{macrocode}
 \ifx\e at alloc@bytecode at count\@undefined
   \countdef\e at alloc@bytecode at count=262
+  \e at alloc@bytecode at count=\z@
 \fi
 \def\newluabytecode#1{%
   \e at alloc\luabytecode\e at alloc@chardef
     \e at alloc@bytecode at count\m at ne\e at alloc@top#1%
 }
-\e at alloc@bytecode at count=\z@
 %    \end{macrocode}
 % \end{macro}
 %
@@ -754,12 +757,14 @@
 
 % \begin{macro}{\newluachunkname}
 % \changes{v1.0a}{2015/09/24}{Macro added}
+% \changes{v1.1q}{2020/08/02}{Move reset to $0$ inside conditional}
 % As for bytecode registers, but in addition we need to add a string
 % to the \verb|lua.name| table to use in stack tracing. We use the
 % name of the command passed to the allocator, with no backslash.
 %    \begin{macrocode}
 \ifx\e at alloc@luachunk at count\@undefined
   \countdef\e at alloc@luachunk at count=263
+  \e at alloc@luachunk at count=\z@
 \fi
 \def\newluachunkname#1{%
   \e at alloc\luachunk\e at alloc@chardef
@@ -767,7 +772,6 @@
     {\escapechar\m at ne
     \directlua{lua.name[\the\allocationnumber]="\string#1"}}%
 }
-\e at alloc@luachunk at count=\z@
 %    \end{macrocode}
 % \end{macro}
 %





More information about the latex3-commits mailing list.