diff options
author | glewis <glewis@FreeBSD.org> | 2004-10-17 01:16:40 +0800 |
---|---|---|
committer | glewis <glewis@FreeBSD.org> | 2004-10-17 01:16:40 +0800 |
commit | d04266084aa6cf788f511bc44986cabeea6f3694 (patch) | |
tree | dfe613061045b633c101547aff06c3f196e27fc6 /java/jdk16 | |
parent | 2a4ef02e1ae89be3762e267b38cc660e6b68f42e (diff) | |
download | freebsd-ports-gnome-d04266084aa6cf788f511bc44986cabeea6f3694.tar.gz freebsd-ports-gnome-d04266084aa6cf788f511bc44986cabeea6f3694.tar.zst freebsd-ports-gnome-d04266084aa6cf788f511bc44986cabeea6f3694.zip |
. Fix the Server VM for gcc 3.4 part 2/2.
The HotSpot code (ab)uses named enums as ints in a number of places.
The problem with this is that according the the C++ spec, the compiler
(essentially) only needs to use an integral type wide enough to hold
the values defined in the enum. Earlier versions of gcc appear to have
just used an int whether they could have got away with a narrower type
or not, hence the code worked as expected. gcc 3.4 now appears to
implement this part of the spec, so using an enum blindly as an int
causes various problems due to overflow.
In this case the enum, Bytecodes::Code, appears to be a genuine enum,
its just assumed to be wide enough to hold an arbitrary int in various
places in the code. The correct fix would be to track down all those
places in the code and fix them. Since there are quite a lot of these
places and 5.3 is close to release for now we just add a value to the
enum set to INT_MAX, forcing the compiler to use at least an int for the
type.
Sleuth work, discussion and code suggestions: peadar
Diffstat (limited to 'java/jdk16')
-rw-r--r-- | java/jdk16/files/patch-interpreter_bytecodes.hpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/java/jdk16/files/patch-interpreter_bytecodes.hpp b/java/jdk16/files/patch-interpreter_bytecodes.hpp new file mode 100644 index 000000000000..112722cac07e --- /dev/null +++ b/java/jdk16/files/patch-interpreter_bytecodes.hpp @@ -0,0 +1,24 @@ +$FreeBSD$ + +--- ../../hotspot/src/share/vm/interpreter/bytecodes.hpp 22 Oct 2003 23:05:03 -0000 1.1.1.3 ++++ ../../hotspot/src/share/vm/interpreter/bytecodes.hpp 12 Oct 2004 05:27:27 -0000 +@@ -6,6 +6,9 @@ + * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. + */ + ++ ++#include <limits.h> ++ + // Bytecodes specifies all bytecodes used in the VM and + // provides utility functions to get bytecode attributes. + +@@ -236,7 +239,8 @@ + // Platform specific JVM bytecodes + #include "incls/_bytecodes_pd.hpp.incl" + +- number_of_codes ++ number_of_codes, ++ WIDTH_HINT = INT_MAX + }; + + private: |