diff options
| author | Paul Eggert | 2017-06-20 08:48:14 -0700 |
|---|---|---|
| committer | Paul Eggert | 2017-06-20 09:01:43 -0700 |
| commit | fb45f7075afa033de27e358739cbda0107af12b2 (patch) | |
| tree | 010d44c8382fd68eb13ae680d96a3cfa83aba25a /src/widget.c | |
| parent | 6fcbbc393eced8350f6d4679d8070bfc48244aab (diff) | |
| download | emacs-fb45f7075afa033de27e358739cbda0107af12b2.tar.gz emacs-fb45f7075afa033de27e358739cbda0107af12b2.zip | |
Fix crash when built by GNU Gold linker on x86
Problem reported by Andrés Musetti (Bug#27248).
* src/widget.c (emacsFrameClassRec): Do not initialize superclass here.
(emacsFrameClass): Now a function (which initializes the
superclass) instead of a variable. All uses changed.
Diffstat (limited to 'src/widget.c')
| -rw-r--r-- | src/widget.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/widget.c b/src/widget.c index d7ec7028517..585039d58c6 100644 --- a/src/widget.c +++ b/src/widget.c | |||
| @@ -108,7 +108,7 @@ emacsFrameTranslations [] = "\ | |||
| 108 | 108 | ||
| 109 | static EmacsFrameClassRec emacsFrameClassRec = { | 109 | static EmacsFrameClassRec emacsFrameClassRec = { |
| 110 | { /* core fields */ | 110 | { /* core fields */ |
| 111 | /* superclass */ &widgetClassRec, | 111 | /* superclass */ 0, /* filled in by emacsFrameClass */ |
| 112 | /* class_name */ (char *) "EmacsFrame", | 112 | /* class_name */ (char *) "EmacsFrame", |
| 113 | /* widget_size */ sizeof (EmacsFrameRec), | 113 | /* widget_size */ sizeof (EmacsFrameRec), |
| 114 | /* class_initialize */ 0, | 114 | /* class_initialize */ 0, |
| @@ -146,7 +146,16 @@ static EmacsFrameClassRec emacsFrameClassRec = { | |||
| 146 | } | 146 | } |
| 147 | }; | 147 | }; |
| 148 | 148 | ||
| 149 | WidgetClass emacsFrameClass = (WidgetClass) &emacsFrameClassRec; | 149 | WidgetClass |
| 150 | emacsFrameClass (void) | ||
| 151 | { | ||
| 152 | /* Set the superclass here rather than relying on static | ||
| 153 | initialization, to work around an unexelf.c bug on x86 platforms | ||
| 154 | that use the GNU Gold linker (Bug#27248). */ | ||
| 155 | emacsFrameClassRec.core_class.superclass = &widgetClassRec; | ||
| 156 | |||
| 157 | return (WidgetClass) &emacsFrameClassRec; | ||
| 158 | } | ||
| 150 | 159 | ||
| 151 | static void | 160 | static void |
| 152 | get_default_char_pixel_size (EmacsFrame ew, int *pixel_width, int *pixel_height) | 161 | get_default_char_pixel_size (EmacsFrame ew, int *pixel_width, int *pixel_height) |