diff options
author | rhatcher <[email protected]> | 2015-07-10 14:22:25 -0500 |
---|---|---|
committer | rhatcher <[email protected]> | 2015-07-10 14:22:25 -0500 |
commit | 179222835fae0cc93b20aef2f877f47c9626f15a (patch) | |
tree | c1df6ce052c9db57f2f13e584f7797033d03f926 /www | |
parent | 1744cccaa63fa27b399b032c7767de2115ba2c7a (diff) |
Expand bitmasks in SWTAccessor GTK_VERSION method
SWTAccessor's GTK_VERSION method accepts a single int argument. The
argument is interpreted as a bit-packed version number with the apparent
intent that the three least significant bytes of the int version number
are the major, minor, and micro version number components.
The code that extracts these three components from the int argument was
using four-bit mask 0x0f instead of eight-bit mask 0xff, and therefore
was discarding the four most significant bits of each component. This
caused any component greater than 15 to lose information. For example,
a component whose value should have been 20 would end up as 4.
The version number is used in comparisons in a static initializer to
determine how to retrieve references to Method objects via reflection.
One such comparison decides whether to retrieve a reference to method
GTK_WIDGET_WINDOW or method gtk_widget_get_window.
The problem initially presented itself after an attempt to use JOGL
with SWT 4.527 and GTK 2.20.1 because this version of SWT removed the
GTK_WIDGET_WINDOW method. Due to the bug SWTAccessor believed the GTK
version was 2.4.1 instead of 2.20.1, so the code attempted to find
GTK_WIDGET_WINDOW instead of gtk_widget_get_window. Because this
method was no longer there a runtime exception was raised.
Diffstat (limited to 'www')
0 files changed, 0 insertions, 0 deletions