]> git.eshelyaron.com Git - emacs.git/commitdiff
* lib-src/etags.c (C_entries): Fix assertion violation.
authorEli Zaretskii <eliz@gnu.org>
Mon, 7 Oct 2024 18:06:34 +0000 (21:06 +0300)
committerEshel Yaron <me@eshelyaron.com>
Mon, 7 Oct 2024 19:31:42 +0000 (21:31 +0200)
(cherry picked from commit ff4de9eff30ade164655354f71e7cbca48135858)

lib-src/etags.c

index 7f652790261370b78dd42f8424c132d72f29767e..4c9b954c9a3bae8d70deebaf618eeada5b6ab2eb 100644 (file)
@@ -4266,7 +4266,10 @@ C_entries (int c_ext,            /* extension of C */
          /* Only if typdef == tinbody is typdefbracelev significant. */
          if (typdef == tinbody && bracelev <= typdefbracelev)
            {
-             assert (bracelev == typdefbracelev);
+             /* If we forcibly reset bracelevel to zero above, let's
+                not shoot ourself in the foot and assert that we didn't.  */
+             if (!(!ignoreindent && lp == newlb.buffer + 1))
+               assert (bracelev == typdefbracelev);
              typdef = tend;
            }
          break;