[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 09/16: [libgroff]: Explicitly construct `default_color`.
From: |
G. Branden Robinson |
Subject: |
[groff] 09/16: [libgroff]: Explicitly construct `default_color`. |
Date: |
Sun, 10 Sep 2023 15:09:34 -0400 (EDT) |
gbranden pushed a commit to branch master
in repository groff.
commit eb1b0b9288a14d6557bab648348a6190056b3cb4
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Wed Sep 6 00:40:08 2023 -0500
[libgroff]: Explicitly construct `default_color`.
Without explicit construction, link-time optimization feels free to send
this object into the twilight zone, subtly changing the semantics of the
current and previous stroke and fill colors, making them interpolate
"default" instead of an empty string.
* src/libs/libgroff/color.cpp: Construct `default_color` with empty
string. Problem appears to date back to commit ea5a42d080,
2002-01-24.
Fixes <https://savannah.gnu.org/bugs/?64421>. Thanks to Günther Noack
for the report, a good reproducer, identification of `-flto=auto` as the
free variable in our experiments, and artifact production beyond the
call of duty; Peter Schaffter for ruling out macro programming goofs;
and Deri James for shrewd pointers in the right direction (twice!).
---
ChangeLog | 20 ++++++++++++++++++++
src/libs/libgroff/color.cpp | 2 +-
2 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
index 9eb87278f..00a747de0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,23 @@
+2023-09-05 G. Branden Robinson <g.branden.robinson@gmail.com>
+
+ [libgroff]: Explicitly construct `default_color`.
+
+ Without explicit construction, link-time optimization feels free
+ to send this object into the twilight zone, subtly changing the
+ semantics of the current and previous stroke and fill colors,
+ making them interpolate "default" instead of an empty string.
+
+ * src/libs/libgroff/color.cpp: Construct `default_color` with
+ empty string instead of leaving uninitalized. Problem appears
+ to date back to commit ea5a42d080, 2002-01-24.
+
+ Fixes <https://savannah.gnu.org/bugs/?64421>. Thanks to Günther
+ Noack for the report, a good reproducer, identification of
+ `-flto=auto` as the free variable in our experiments, and
+ artifact production beyond the call of duty; Peter Schaffter for
+ ruling out macro programming goofs; and Deri James for shrewd
+ pointers in the right direction (twice!).
+
2023-09-05 G. Branden Robinson <g.branden.robinson@gmail.com>
[troff]: Regression-test Savannah #64421.
diff --git a/src/libs/libgroff/color.cpp b/src/libs/libgroff/color.cpp
index 388c2ee9e..32a1bc8e7 100644
--- a/src/libs/libgroff/color.cpp
+++ b/src/libs/libgroff/color.cpp
@@ -395,7 +395,7 @@ char *color::print_color()
return s;
}
-color default_color;
+color default_color("");
// Local Variables:
// fill-column: 72
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 09/16: [libgroff]: Explicitly construct `default_color`.,
G. Branden Robinson <=