bug-groff
[Top][All Lists]
Advanced

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

[bug #61100] [troff] do_request(): assertion failed: 'do_old_compatible_


From: G. Branden Robinson
Subject: [bug #61100] [troff] do_request(): assertion failed: 'do_old_compatible_flag == -1'
Date: Tue, 3 Sep 2024 12:16:32 -0400 (EDT)

Update of bug #61100 (group groff):

                  Status:             In Progress => Fixed                  
             Open/Closed:                    Open => Closed                 
         Planned Release:                    None => 1.24.0                 

    _______________________________________________________

Follow-up Comment #9:


commit c6bcc7ea6921c35074132689eb55e43d531663c4
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Sun Sep 1 21:06:16 2024 -0500

    [groff]: Regression-test Savannah #61100.
    
    * src/roff/groff/tests/double-do-request-does-not-raise-assertion.sh: Do
      it.
    * src/roff/groff/groff.am (groff_TESTS): Run test.
    
    Test fails at this commit.

commit d50be3efd3e5b4d1e139c420a75be6686a318427
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Mon Sep 2 00:43:47 2024 -0500

    [troff]: Fix Savannah #61100.
    
    Prevent nested use of `do` requests from causing an assertion failure.
    
    * src/roff/troff/input.cpp: Improve handling of nested selections of
      compatibility mode.  Use a global STL stack of `bool`,
      `want_att_compat_stack`, to manage them.  Drop global `int`
      `do_old_want_att_compat` with its less-useful-than-hoped "-1" value to
      signal an outermost "scope".
    
      (do_request): Drop dubious `assert()`ion.  Push the value of
      `want_att_compat` onto the stack before invoking/calling the named
      request/macro, and pop it afterwards.
    
      (class enclosing_want_att_compat_reg): Add new class to handle dynamic
      construction of `.cp` register value.  I modeled the approach on an
      idiom heavily used in "env.cpp", where read-only registers are not
      modeled as accessors of C++ globals, because they interpolate
      per-environment state.
    
      (enclosing_want_att_compat_reg::get_string): Member function of new
      class constructs `.cp` register value by peeking at the top of
      `want_att_compat_stack`.
    
      (init_input_requests): Wire up `.cp` register to an object of
      `enclosing_want_att_compat_reg` class instead of now-dead
      `do_old_want_att_compat` global.
    
    Fixes <https://savannah.gnu.org/bugs/?66110>.  Problem introduced by me
    when introducing `.cp` register in commit 6a37bb5f00, 17 April 2020.
    Thanks to Bjarni Ingi Gislason for suggesting the direction a minimal
    reproducer could take.




    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?61100>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/

Attachment: signature.asc
Description: PGP signature


reply via email to

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