summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/ptexdir
diff options
context:
space:
mode:
authorHironobu Yamashita <h.y.acetaminophen@gmail.com>2021-06-25 08:59:50 +0000
committerHironobu Yamashita <h.y.acetaminophen@gmail.com>2021-06-25 08:59:50 +0000
commit0ddcde597b889089494d2a84f307947c67bcd3c1 (patch)
treef32b7c70e7437af5c48a56df9c854dceb8f3a20f /Build/source/texk/web2c/ptexdir
parentb3a43403a70c9cc74b45548e79501eaa43b65411 (diff)
ptex: fix segmentation fault for disp_node-only paragraphs in line_break
git-svn-id: svn://tug.org/texlive/trunk@59697 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/ptexdir')
-rw-r--r--Build/source/texk/web2c/ptexdir/ChangeLog9
-rw-r--r--Build/source/texk/web2c/ptexdir/ptex-base.ch12
2 files changed, 19 insertions, 2 deletions
diff --git a/Build/source/texk/web2c/ptexdir/ChangeLog b/Build/source/texk/web2c/ptexdir/ChangeLog
index 78e691a28de..a0d629e2a54 100644
--- a/Build/source/texk/web2c/ptexdir/ChangeLog
+++ b/Build/source/texk/web2c/ptexdir/ChangeLog
@@ -1,3 +1,12 @@
+2021-06-25 Hironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
+ and Hironobu Yamashita <h.y.acetaminophen@gmail.com>
+
+ * ptex-base.ch (end_graf, @<Go into display math mode@>):
+ Ignore disp_node-only paragraphs.
+ * ptex-base.ch (line_break): consider when link(temp_head)=tail
+ and it is a disp_node.
+ https://github.com/texjporg/tex-jp-build/issues/123
+
2021-03-23 Karl Berry <karl@tug.org>
* TL'21.
diff --git a/Build/source/texk/web2c/ptexdir/ptex-base.ch b/Build/source/texk/web2c/ptexdir/ptex-base.ch
index c1b23f1c8c7..bb45acdb3c1 100644
--- a/Build/source/texk/web2c/ptexdir/ptex-base.ch
+++ b/Build/source/texk/web2c/ptexdir/ptex-base.ch
@@ -4185,10 +4185,10 @@ first_use:=true; chain:=false;
delete_glue_ref(cur_kanji_skip); delete_glue_ref(cur_xkanji_skip);
cur_kanji_skip:=space_ptr(head); cur_xkanji_skip:=xspace_ptr(head);
add_glue_ref(cur_kanji_skip); add_glue_ref(cur_xkanji_skip);
-link(temp_head):=link(head);
if not is_char_node(tail)and(type(tail)=disp_node) then
begin free_node(tail,small_node_size); tail:=prev_node; link(tail):=null
end;
+link(temp_head):=link(head);
if is_char_node(tail) then tail_append(new_penalty(inf_penalty))
else if type(tail)<>glue_node then tail_append(new_penalty(inf_penalty))
@z
@@ -5274,7 +5274,10 @@ mode:=hmode; space_factor:=1000; set_cur_lang; clang:=cur_lang;
begin if head=tail then pop_nest {null paragraphs are ignored}
else line_break(widow_penalty);
@y
- begin if head=tail then pop_nest {null paragraphs are ignored}
+ begin if (link(head)=tail)and(not is_char_node(tail)and(type(tail)=disp_node)) then
+ begin free_node(tail,small_node_size); tail:=head; link(head):=null; end;
+ { |disp_node|-only paragraphs are ignored }
+ if head=tail then pop_nest {null paragraphs are ignored}
else begin adjust_hlist(head,true); line_break(widow_penalty)
end;
@z
@@ -5732,6 +5735,11 @@ direction:=-abs(direction);
@x [48.1145] l.22435 - pTeX: Call adjust_hlist at begin of display
else begin line_break(display_widow_penalty);@/
@y
+else if (link(head)=tail)and(not is_char_node(tail)and(type(tail)=disp_node)) then
+ begin free_node(tail,small_node_size); tail:=head; link(head):=null;
+ pop_nest; w:=-max_dimen;
+ end
+ { |disp_node|-only paragraphs are ignored }
else begin adjust_hlist(head,true); line_break(display_widow_penalty);@/
@z