summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
authorLuigi Scarso <luigi.scarso@gmail.com>2025-02-02 12:36:07 +0000
committerLuigi Scarso <luigi.scarso@gmail.com>2025-02-02 12:36:07 +0000
commit983b2a015ab122b8b609444c87d675712cef0d72 (patch)
treef1c79c7b47318c6b8f852cff6f92929a33344edb /Build
parentb8762fedf71f52bace5b0efbb94111d21da89fec (diff)
Sync with upstream luatex (not luajit).
git-svn-id: svn://tug.org/texlive/trunk@73690 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rw-r--r--Build/source/texk/web2c/luatexdir/ChangeLog35
-rw-r--r--Build/source/texk/web2c/luatexdir/font/tfmofm.c14
-rw-r--r--Build/source/texk/web2c/luatexdir/image/pdftoepdf.c4
-rw-r--r--Build/source/texk/web2c/luatexdir/lang/texlang.c6
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/lcallbacklib.c2
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/lnodelib.c48
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/luainit.c2
-rw-r--r--Build/source/texk/web2c/luatexdir/luatex.c6
-rw-r--r--Build/source/texk/web2c/luatexdir/luatex_svnversion.h2
-rw-r--r--Build/source/texk/web2c/luatexdir/luatexcallbackids.h2
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/commands.c1
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/equivalents.h6
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/errors.c31
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/errors.h1
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/mlist.c1
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/packaging.c7
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/texmath.c16
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/texnodes.c46
18 files changed, 159 insertions, 71 deletions
diff --git a/Build/source/texk/web2c/luatexdir/ChangeLog b/Build/source/texk/web2c/luatexdir/ChangeLog
index cfb81172427..fda39ba2691 100644
--- a/Build/source/texk/web2c/luatexdir/ChangeLog
+++ b/Build/source/texk/web2c/luatexdir/ChangeLog
@@ -1,3 +1,28 @@
+2025-02-01 Luigi Scarso <luigi.scarso@gmail.com>
+ * LuaJIT 2.1.1736781742 (work in progress)
+ * LuaTeX 1.21.0
+
+
+2025-02-01 Luigi Scarso <luigi.scarso@gmail.com>
+ * Again on missing displacement when leqno is used in rtl paragraph (thanks to udifoglle@gmail.com)
+ * LuaTeX 1.20.8
+
+
+2025-02-01 Luigi Scarso <luigi.scarso@gmail.com>
+ * Fix getdisc tail fields and some related sanity check cleanup (HH)
+ * LuaTeX 1.20.7
+
+
+2025-02-01 Luigi Scarso <luigi.scarso@gmail.com>
+ * Fixed missing displacement when leqno is used in rtl paragraph (thanks to udifoglle@gmail.com)
+ * LuaTeX 1.20.6
+
+
+2025-01-31 Luigi Scarso <luigi.scarso@gmail.com>
+ * In read_tfm_info avoid scaling fonts to >= 2048pt, which can cause overflow (TeXLive rev. 73614)
+ * \ignoreprimitiveerror as in pdftex
+
+
2025-01-19 Luigi Scarso <luigi.scarso@gmail.com>
* Fixed \shapemode does not reset at end of paragraphs (thanks to udifoglle@gmail.com)
@@ -7,29 +32,29 @@
* LuaTeX 1.20.5
-2025-01-04 Luigi Scarso <luigi.scarso@gmail.com>
+2025-01-11 Luigi Scarso <luigi.scarso@gmail.com>
* fixed "unexpected delimiter construction with classic tfm cmex font",
see https://tex.stackexchange.com/a/734734/1090 (HH)
* LuaTeX 1.20.4
-2025-01-04 Luigi Scarso <luigi.scarso@gmail.com>
+2025-01-09 Luigi Scarso <luigi.scarso@gmail.com>
* replaced # error with # define UNSUPPORTED_ARCH in ffi.[ch]
* LuaTeX 1.20.3
-2025-01-04 Luigi Scarso <luigi.scarso@gmail.com>
+2025-01-06 Luigi Scarso <luigi.scarso@gmail.com>
* ffi.h: do not assume that struct cdata is aligned(16).
* More fixes for luaffi.
* LuaTeX 1.20.2
-2025-01-06 Luigi Scarso <luigi.scarso@gmail.com>
+2025-01-04 Luigi Scarso <luigi.scarso@gmail.com>
* Clean-up ffi.h
* LuaTeX 1.20.1
-2025-01-01 Luigi Scarso <luigi.scarso@gmail.com>
+2025-01-02 Luigi Scarso <luigi.scarso@gmail.com>
* New luaffi, support for aarch64.
* LuaTeX 1.20.0
diff --git a/Build/source/texk/web2c/luatexdir/font/tfmofm.c b/Build/source/texk/web2c/luatexdir/font/tfmofm.c
index f5d8c2e92f3..57989b8c8ed 100644
--- a/Build/source/texk/web2c/luatexdir/font/tfmofm.c
+++ b/Build/source/texk/web2c/luatexdir/font/tfmofm.c
@@ -849,7 +849,21 @@ int read_tfm_info(internal_font_number f, const char *cnom, scaled s)
/*tex Read the arrays before the character info. */
set_font_dsize(f, z);
if (s != -1000) {
+ boolean saved_arith_error = arith_error;
+ scaled sw = z;
+ arith_error = false;
z = (s >= 0 ? s : xn_over_d(z, -s, 1000));
+ if ((arith_error) || (z>= 01000000000)) {
+ char err[256];
+ const char *errhelp[] = {
+ "I will ignore the scaling factor.",
+ NULL
+ };
+ snprintf(err, 255, "Font scaled to 2048pt or higher");
+ tex_error(err, errhelp);
+ }
+ z = sw ;
+ arith_error = saved_arith_error;
}
set_font_size(f, z);
if (np > 7) {
diff --git a/Build/source/texk/web2c/luatexdir/image/pdftoepdf.c b/Build/source/texk/web2c/luatexdir/image/pdftoepdf.c
index 315d6bdacc7..7f2ccaf9a6a 100644
--- a/Build/source/texk/web2c/luatexdir/image/pdftoepdf.c
+++ b/Build/source/texk/web2c/luatexdir/image/pdftoepdf.c
@@ -361,9 +361,11 @@ static int addInObj(PDF pdf, PdfDocument * pdf_doc, ppref * ref)
because new objects are being added while the list is being
written out by writeRefs().
*/
+ q = NULL;
for (p = pdf_doc->inObjList; p != NULL; p = p->next)
q = p;
- q->next = n;
+ if (q)
+ q->next = n;
}
return n->num;
}
diff --git a/Build/source/texk/web2c/luatexdir/lang/texlang.c b/Build/source/texk/web2c/luatexdir/lang/texlang.c
index a7a741b55cb..4b5903a4dde 100644
--- a/Build/source/texk/web2c/luatexdir/lang/texlang.c
+++ b/Build/source/texk/web2c/luatexdir/lang/texlang.c
@@ -213,7 +213,6 @@ const char *clean_hyphenation(int id, const char *buff, char **cleaned)
int i = 0;
char *uindex = (char *)word;
const char *s = buff;
-
while (*s && !isspace((unsigned char)*s)) {
word[i++] = (unsigned)*s;
s++;
@@ -472,7 +471,8 @@ static halfword compound_word_break(halfword t, int clang)
void set_disc_field(halfword f, halfword t)
{
if (t != null) {
- couple_nodes(f, t);
+ alink(t) = null; /* don't expose this one! */
+ vlink(f) = t;
tlink(f) = tail_of_list(t);
} else {
vlink(f) = null;
@@ -943,7 +943,7 @@ void hnj_hyphenation(halfword head, halfword tail)
int lchar, i;
struct tex_language *lang;
lang_variables langdata;
- char utf8word[(4 * MAX_WORD_LEN) + 1];
+ char utf8word[(4 * MAX_WORD_LEN) + 1] = { 0 };
int wordlen = 0;
char *hy = utf8word;
char *replacement = NULL;
diff --git a/Build/source/texk/web2c/luatexdir/lua/lcallbacklib.c b/Build/source/texk/web2c/luatexdir/lua/lcallbacklib.c
index c4472c07f7f..4c5bf74c036 100644
--- a/Build/source/texk/web2c/luatexdir/lua/lcallbacklib.c
+++ b/Build/source/texk/web2c/luatexdir/lua/lcallbacklib.c
@@ -68,7 +68,7 @@ static const char *const callbacknames[] = {
"finish_pdffile",
"finish_pdfpage",
"pre_dump","start_file", "stop_file",
- "show_error_message","show_lua_error_hook",
+ "show_error_message","show_lua_error_hook","show_ignored_error_message",
"show_warning_message",
"hpack_quality", "vpack_quality",
"process_rule",
diff --git a/Build/source/texk/web2c/luatexdir/lua/lnodelib.c b/Build/source/texk/web2c/luatexdir/lua/lnodelib.c
index 72dbe01b076..bb265a31d1f 100644
--- a/Build/source/texk/web2c/luatexdir/lua/lnodelib.c
+++ b/Build/source/texk/web2c/luatexdir/lua/lnodelib.c
@@ -1187,9 +1187,9 @@ static int lua_nodelib_direct_getdisc(lua_State * L)
nodelib_pushdirect_or_nil_alink(vlink(post_break(n)));
nodelib_pushdirect_or_nil_alink(vlink(no_break(n)));
if (lua_isboolean(L, 2) && lua_toboolean(L, 2)) {
- nodelib_pushdirect_or_nil_alink(tlink(pre_break(n)));
- nodelib_pushdirect_or_nil_alink(tlink(post_break(n)));
- nodelib_pushdirect_or_nil_alink(tlink(no_break(n)));
+ nodelib_pushdirect_or_nil(tlink(pre_break(n)));
+ nodelib_pushdirect_or_nil(tlink(post_break(n)));
+ nodelib_pushdirect_or_nil(tlink(no_break(n)));
return 6;
}
return 3;
@@ -8542,19 +8542,24 @@ static int lua_nodelib_direct_effective_glue(lua_State * L)
*/
-#define check_disc(c) \
- p = c ; \
- if (p != null && vlink(p) != null) \
- tlink(p) = tail_of_list(vlink(p));
+static void check_disc(halfword p)
+{
+ if (p != null) {
+ if (vlink(p) != null) {
+ tlink(p) = tail_of_list(vlink(p));
+ } else {
+ tlink(p) = null;
+ }
+ }
+}
static int lua_nodelib_direct_check_discretionaries(lua_State * L) {
halfword c = lua_tointeger(L, 1);
- halfword p ;
while (c != null) {
if (type(c) == disc_node) {
- check_disc(no_break(c)) ;
- check_disc(pre_break(c)) ;
- check_disc(post_break(c)) ;
+ check_disc(no_break(c));
+ check_disc(pre_break(c));
+ check_disc(post_break(c));
}
c = vlink(c) ;
}
@@ -8564,10 +8569,9 @@ static int lua_nodelib_direct_check_discretionaries(lua_State * L) {
static int lua_nodelib_direct_check_discretionary(lua_State * L) {
halfword c = lua_tointeger(L, 1);
if (c != null && type(c) == disc_node) {
- halfword p ;
- check_disc(no_break(c)) ;
- check_disc(pre_break(c)) ;
- check_disc(post_break(c)) ;
+ check_disc(no_break(c));
+ check_disc(pre_break(c));
+ check_disc(post_break(c));
}
return 0;
}
@@ -8614,12 +8618,11 @@ static int lua_nodelib_direct_flatten_discretionaries(lua_State * L)
static int lua_nodelib_check_discretionaries(lua_State * L) {
halfword c = *check_isnode(L, 1);
- halfword p ;
while (c != null) {
if (type(c) == disc_node) {
- check_disc(no_break(c)) ;
- check_disc(pre_break(c)) ;
- check_disc(post_break(c)) ;
+ check_disc(no_break(c));
+ check_disc(pre_break(c));
+ check_disc(post_break(c));
}
c = vlink(c) ;
}
@@ -8629,10 +8632,9 @@ static int lua_nodelib_check_discretionaries(lua_State * L) {
static int lua_nodelib_check_discretionary(lua_State * L) {
halfword c = *check_isnode(L, 1);
if (c != null && type(c) == disc_node) {
- halfword p ;
- check_disc(no_break(c)) ;
- check_disc(pre_break(c)) ;
- check_disc(post_break(c)) ;
+ check_disc(no_break(c));
+ check_disc(pre_break(c));
+ check_disc(post_break(c));
}
return 0;
}
diff --git a/Build/source/texk/web2c/luatexdir/lua/luainit.c b/Build/source/texk/web2c/luatexdir/lua/luainit.c
index 1b932a29ca2..dad4ef7167f 100644
--- a/Build/source/texk/web2c/luatexdir/lua/luainit.c
+++ b/Build/source/texk/web2c/luatexdir/lua/luainit.c
@@ -491,7 +491,7 @@ static void parse_options(int ac, char **av)
"the terms of the GNU General Public License, version 2 or (at your option)\n"
"any later version. For more information about these matters, see the file\n"
"named COPYING and the LuaTeX source.\n\n"
- "LuaTeX is Copyright 2022 Taco Hoekwater and the LuaTeX Team.\n");
+ "LuaTeX is Copyright 2025 Taco Hoekwater and the LuaTeX Team.\n");
/* *INDENT-ON* */
uexit(0);
} else if (ARGUMENT_IS("credits")) {
diff --git a/Build/source/texk/web2c/luatexdir/luatex.c b/Build/source/texk/web2c/luatexdir/luatex.c
index 1f5465784af..d64947b9162 100644
--- a/Build/source/texk/web2c/luatexdir/luatex.c
+++ b/Build/source/texk/web2c/luatexdir/luatex.c
@@ -32,9 +32,9 @@
stick to "0" upto "9" so users can expect a number represented as string.
*/
-int luatex_version = 120;
-int luatex_revision = '5';
-const char *luatex_version_string = "1.20.5";
+int luatex_version = 121;
+int luatex_revision = '0';
+const char *luatex_version_string = "1.21.0";
const char *engine_name = my_name;
#include <kpathsea/c-ctype.h>
diff --git a/Build/source/texk/web2c/luatexdir/luatex_svnversion.h b/Build/source/texk/web2c/luatexdir/luatex_svnversion.h
index 75176b33ff3..4f52995f02e 100644
--- a/Build/source/texk/web2c/luatexdir/luatex_svnversion.h
+++ b/Build/source/texk/web2c/luatexdir/luatex_svnversion.h
@@ -1,4 +1,4 @@
#ifndef luatex_svn_revision_h
#define luatex_svn_revision_h
-#define luatex_svn_revision 7643
+#define luatex_svn_revision 7653
#endif
diff --git a/Build/source/texk/web2c/luatexdir/luatexcallbackids.h b/Build/source/texk/web2c/luatexdir/luatexcallbackids.h
index 7a56a86b932..fbb037462ad 100644
--- a/Build/source/texk/web2c/luatexdir/luatexcallbackids.h
+++ b/Build/source/texk/web2c/luatexdir/luatexcallbackids.h
@@ -60,7 +60,7 @@ typedef enum {
finish_pdfpage_callback,
pre_dump_callback,
start_file_callback, stop_file_callback,
- show_error_message_callback, show_lua_error_hook_callback,
+ show_error_message_callback, show_lua_error_hook_callback,show_ignored_error_message_callback,
show_warning_message_callback,
hpack_quality_callback, vpack_quality_callback,
process_rule_callback,
diff --git a/Build/source/texk/web2c/luatexdir/tex/commands.c b/Build/source/texk/web2c/luatexdir/tex/commands.c
index 1c768cb174b..371626daf53 100644
--- a/Build/source/texk/web2c/luatexdir/tex/commands.c
+++ b/Build/source/texk/web2c/luatexdir/tex/commands.c
@@ -789,6 +789,7 @@ void initialize_etex_commands(void)
primitive_etex("lastlinefit", assign_int_cmd, int_base + last_line_fit_code, int_base);
primitive_etex("savingvdiscards", assign_int_cmd, int_base + saving_vdiscards_code, int_base);
primitive_etex("savinghyphcodes", assign_int_cmd, int_base + saving_hyph_codes_code, int_base);
+ primitive_etex("ignoreprimitiveerror", assign_int_cmd, int_base + ignore_primitive_error_code, int_base);
primitive_luatex("suppressfontnotfounderror", assign_int_cmd, int_base + suppress_fontnotfound_error_code, int_base);
primitive_luatex("suppresslongerror", assign_int_cmd, int_base + suppress_long_error_code, int_base);
primitive_luatex("suppressprimitiveerror", assign_int_cmd, int_base + suppress_primitive_error_code, int_base);
diff --git a/Build/source/texk/web2c/luatexdir/tex/equivalents.h b/Build/source/texk/web2c/luatexdir/tex/equivalents.h
index f755af60a3f..bf329b3a1be 100644
--- a/Build/source/texk/web2c/luatexdir/tex/equivalents.h
+++ b/Build/source/texk/web2c/luatexdir/tex/equivalents.h
@@ -316,7 +316,10 @@ the |number_regs| \.{\\dimen} registers.
# define math_eq_dir_mode_code 123
# define var_fam_code 124
-# define math_option_code 125
+# define ignore_primitive_error_code 125 /*ignore some primitive/engine errors*/
+
+# define math_option_code 126
+
# define mathoption_int_base_code (math_option_code+1) /* one reserve */
# define mathoption_int_last_code (mathoption_int_base_code+8)
@@ -805,6 +808,7 @@ extern halfword last_cs_name;
#define default_hyphen_char_par int_par(default_hyphen_char_code)
#define default_skew_char_par int_par(default_skew_char_code)
#define saving_hyph_codes_par int_par(saving_hyph_codes_code)
+#define ignore_primitive_error_par int_par(ignore_primitive_error_code)
#define hyphen_penalty_mode_par int_par(hyphen_penalty_mode_code)
#define automatic_hyphen_penalty_par int_par(automatic_hyphen_penalty_code)
diff --git a/Build/source/texk/web2c/luatexdir/tex/errors.c b/Build/source/texk/web2c/luatexdir/tex/errors.c
index 01b6f44aada..52469404824 100644
--- a/Build/source/texk/web2c/luatexdir/tex/errors.c
+++ b/Build/source/texk/web2c/luatexdir/tex/errors.c
@@ -106,7 +106,12 @@ void flush_err(void)
if (callback_id > 0) {
run_callback(callback_id, "->");
} else {
- tprint(s);
+ callback_id = callback_defined(show_ignored_error_message_callback);
+ if (callback_id > 0) {
+ run_callback(callback_id, "->");
+ } else {
+ tprint(s);
+ }
}
in_error = 0 ;
}
@@ -136,6 +141,30 @@ void print_err(const char *s)
}
}
+void print_ignored_err(const char *s)
+{
+ int callback_id = callback_defined(show_ignored_error_message_callback);
+ if (interaction == error_stop_mode) {
+ wake_up_terminal();
+ }
+ if (callback_id > 0) {
+ err_old_setting = selector;
+ selector = new_string;
+ in_error = 1 ;
+ }
+ if (filelineerrorstylep) {
+ print_file_line();
+ } else {
+ tprint_nl("ignored error ");
+ }
+ tprint(s);
+ if (callback_id <= 0) {
+ xfree(last_error);
+ last_error = (string) xmalloc((unsigned) (strlen(s) + 1));
+ strcpy(last_error,s);
+ }
+}
+
/*tex
\TeX\ is careful not to call |error| when the print |selector| setting might be
diff --git a/Build/source/texk/web2c/luatexdir/tex/errors.h b/Build/source/texk/web2c/luatexdir/tex/errors.h
index 39fdf6b46e2..fa072295791 100644
--- a/Build/source/texk/web2c/luatexdir/tex/errors.h
+++ b/Build/source/texk/web2c/luatexdir/tex/errors.h
@@ -50,6 +50,7 @@ extern char *last_error_context;
extern void set_last_error_context(void);
extern void print_err(const char *s);
+extern void print_ignored_err(const char *s);
extern void fixup_selector(boolean log_opened);
diff --git a/Build/source/texk/web2c/luatexdir/tex/mlist.c b/Build/source/texk/web2c/luatexdir/tex/mlist.c
index f789b0f6e24..35e9cd774c2 100644
--- a/Build/source/texk/web2c/luatexdir/tex/mlist.c
+++ b/Build/source/texk/web2c/luatexdir/tex/mlist.c
@@ -1553,6 +1553,7 @@ static pointer do_delimiter(pointer q, pointer d, int s, scaled v, boolean flat,
return b;
}
+ x = 0;
f = null_font;
c = 0;
if (d == null) {
diff --git a/Build/source/texk/web2c/luatexdir/tex/packaging.c b/Build/source/texk/web2c/luatexdir/tex/packaging.c
index 3d23c8b7320..c69f65d7aa8 100644
--- a/Build/source/texk/web2c/luatexdir/tex/packaging.c
+++ b/Build/source/texk/web2c/luatexdir/tex/packaging.c
@@ -1854,7 +1854,11 @@ halfword vert_break(halfword p, scaled h, scaled d)
active_height[2 + stretch_order(p)] += stretch(p);
active_height[7] += shrink(p);
if ((shrink_order(p) != normal) && (shrink(p) != 0)) {
+ if (((unsigned int)ignore_primitive_error_par) & 0x1){
+ print_ignored_err("Infinite glue shrinkage found in box being split");
+ } else {
print_err("Infinite glue shrinkage found in box being split");
+
help4(
"The box you are \\vsplitting contains some infinitely",
"shrinkable glue, e.g., `\\vss' or `\\vskip 0pt minus 1fil'.",
@@ -1862,7 +1866,8 @@ halfword vert_break(halfword p, scaled h, scaled d)
"since the offensive shrinkability has been made finite."
);
error();
- shrink_order(p) = normal;
+ }
+ shrink_order(p) = normal;
}
}
cur_height = cur_height + prev_dp + width(p);
diff --git a/Build/source/texk/web2c/luatexdir/tex/texmath.c b/Build/source/texk/web2c/luatexdir/tex/texmath.c
index 8b6138e7cbb..4b34c17234a 100644
--- a/Build/source/texk/web2c/luatexdir/tex/texmath.c
+++ b/Build/source/texk/web2c/luatexdir/tex/texmath.c
@@ -2565,21 +2565,20 @@ static void finish_displayed_math(boolean l, pointer eqno_box, pointer p)
if (math_direction_par==dir_TLT) {
/*tex TRT + TLT + \eqno: (swap_dir=true, math_direction_par=TLT, l=true) */
s = new_kern(width(r) + eqno_w);
- try_couple_nodes(eqno_box,r);
- try_couple_nodes(r,eq_box);
- try_couple_nodes(eq_box,s);
} else {
/*tex TLT + TRT + \eqno: (swap_dir=true, math_direction_par=TRT, l=true) */
- try_couple_nodes(eqno_box,r);
- try_couple_nodes(r,eq_box);
+ s = new_kern(d);
}
+ try_couple_nodes(eqno_box,r);
+ try_couple_nodes(r,eq_box);
+ try_couple_nodes(eq_box,s);
} else {
if (math_direction_par==dir_TLT) {
/*tex TLT + TLT + \leqno: (swap_dir=false, math_direction_par=TLT, l=true) */
s = new_kern(width(r) + eqno_w);
} else {
/*tex TRT + TRT + \leqno: (swap_dir=false, math_direction_par=TRT, l=true) */
- s = new_kern(width(r));
+ s = new_kern(d);
}
try_couple_nodes(eqno_box,r);
try_couple_nodes(r,eq_box);
@@ -2590,9 +2589,12 @@ static void finish_displayed_math(boolean l, pointer eqno_box, pointer p)
if (swap_dir) {
if (math_direction_par==dir_TLT) {
/*tex TRT + TLT + \leqno: (swap_dir=true, math_direction_par=TLT, l=false) */
+ s = new_kern(d);
} else {
/*tex TLT + TRT + \leqno: (swap_dir=true, math_direction_par=TRT, l=false) */
+ s = new_kern(width(r) + eqno_w);
}
+ try_couple_nodes(s,eq_box);
try_couple_nodes(eq_box,r);
try_couple_nodes(r,eqno_box);
} else {
@@ -2606,8 +2608,8 @@ static void finish_displayed_math(boolean l, pointer eqno_box, pointer p)
try_couple_nodes(s,eq_box);
try_couple_nodes(eq_box,r);
try_couple_nodes(r,eqno_box);
- eq_box = s;
}
+ eq_box = s;
}
eq_box = hpack(eq_box, 0, additional, -1);
subtype(eq_box) = equation_list; /* new */
diff --git a/Build/source/texk/web2c/luatexdir/tex/texnodes.c b/Build/source/texk/web2c/luatexdir/tex/texnodes.c
index 72f6716dd93..47eda07cb8c 100644
--- a/Build/source/texk/web2c/luatexdir/tex/texnodes.c
+++ b/Build/source/texk/web2c/luatexdir/tex/texnodes.c
@@ -2018,6 +2018,17 @@ void copy_node_wrapup_pdf(halfword p, halfword r)
}
}
+static void check_disc(halfword p)
+{
+ if (p != null) {
+ if (vlink(p) != null) {
+ tlink(p) = tail_of_list(vlink(p));
+ } else {
+ tlink(p) = null;
+ }
+ }
+}
+
halfword copy_node(const halfword p)
{
/*tex current node being fabricated for new list */
@@ -2091,31 +2102,22 @@ halfword copy_node(const halfword p)
break;
case disc_node:
pre_break(r) = pre_break_head(r);
- if (vlink_pre_break(p) != null) {
- s = copy_node_list(vlink_pre_break(p));
- alink(s) = pre_break(r);
- tlink_pre_break(r) = tail_of_list(s);
- vlink_pre_break(r) = s;
- } else {
- assert(tlink(pre_break(r)) == null);
- }
post_break(r) = post_break_head(r);
- if (vlink_post_break(p) != null) {
- s = copy_node_list(vlink_post_break(p));
- alink(s) = post_break(r);
- tlink_post_break(r) = tail_of_list(s);
- vlink_post_break(r) = s;
- } else {
- assert(tlink_post_break(r) == null);
- }
no_break(r) = no_break_head(r);
+ if (vlink(pre_break(p)) != null) {
+ s = copy_node_list(vlink(pre_break(p)));
+ vlink(pre_break(r)) = s;
+ check_disc(pre_break(r));
+ }
+ if (vlink(post_break(p)) != null) {
+ s = copy_node_list(vlink(post_break(p)));
+ vlink(post_break(r)) = s;
+ check_disc(post_break(r));
+ }
if (vlink(no_break(p)) != null) {
- s = copy_node_list(vlink_no_break(p));
- alink(s) = no_break(r);
- tlink_no_break(r) = tail_of_list(s);
- vlink_no_break(r) = s;
- } else {
- assert(tlink_no_break(r) == null);
+ s = copy_node_list(vlink(no_break(p)));
+ vlink(no_break(r)) = s;
+ check_disc(no_break(r));
}
break;
case math_node: