texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: * tp/Texinfo/XS/parsetexi/input.c (next_text): af


From: Patrice Dumas
Subject: branch master updated: * tp/Texinfo/XS/parsetexi/input.c (next_text): after calling input_push_text for delcomment, set the input pointer again as the input stack may have been reallocated.
Date: Tue, 07 Feb 2023 16:52:14 -0500

This is an automated email from the git hooks/post-receive script.

pertusus pushed a commit to branch master
in repository texinfo.

The following commit(s) were added to refs/heads/master by this push:
     new 618f3bdd6f * tp/Texinfo/XS/parsetexi/input.c (next_text): after 
calling input_push_text for delcomment, set the input pointer again as the 
input stack may have been reallocated.
618f3bdd6f is described below

commit 618f3bdd6f6f863d31142216ec538f744f7eae9a
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Tue Feb 7 22:52:03 2023 +0100

    * tp/Texinfo/XS/parsetexi/input.c (next_text): after calling
    input_push_text for delcomment, set the input pointer again as the
    input stack may have been reallocated.
---
 ChangeLog                       | 6 ++++++
 tp/Texinfo/XS/parsetexi/input.c | 6 ++++++
 2 files changed, 12 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index b66f7c828b..ffdb18437f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2023-02-07  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/XS/parsetexi/input.c (next_text): after calling
+       input_push_text for delcomment, set the input pointer again as the
+       input stack may have been reallocated.
+
 2023-02-07  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/ParserNonXS.pm (_next_text),
diff --git a/tp/Texinfo/XS/parsetexi/input.c b/tp/Texinfo/XS/parsetexi/input.c
index 5a202da0ac..401325e937 100644
--- a/tp/Texinfo/XS/parsetexi/input.c
+++ b/tp/Texinfo/XS/parsetexi/input.c
@@ -461,6 +461,12 @@ next_text (ELEMENT *current)
                     source_mark->line = 0;
                   input_push_text(strdup (""),
                                   input->source_info.line_nr, 0, 0);
+                  /* if the input_stack was reallocated in input_push_text,
+                     the input pointer for the file may have been freed and
+                     re-created at another address.  Therefore we reset it.
+                     input_number has been increased too, so the input file
+                     being processed is now at input_number - 2 */
+                  input = &input_stack[input_number - 2];
                   set_input_source_mark (source_mark);
                 }
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]