Bug on Solaris

Jeff Sturm jsturm@one-point.com
Tue Jan 8 13:43:00 GMT 2002


On Tue, 8 Jan 2002, Andrew Haley wrote:
> It is, however, a front end bug that manifests itself only when
> running on SPARC.  Endian, perhaps?

Perhaps.  There's a problem while reading in the constant pool from an
existing class file.  (If it is a big-endian problem, shouldn't it fail on
PPC too?)

I'm looking at jcf-parse.c:get_constant.  This code looks suspicious:

    case CONSTANT_Double:
      {
        HOST_WIDE_INT num[2];
        REAL_VALUE_TYPE d;
        HOST_WIDE_INT lo, hi;
        num[0] = JPOOL_INT (jcf, index);
        lshift_double (num[0], 0, 32, 64, &lo, &hi, 0);
        num[0] = JPOOL_INT (jcf, index+1);
        add_double (lo, hi, num[0], 0, &lo, &hi);
        if (FLOAT_WORDS_BIG_ENDIAN)
          {
            num[0] = hi;
            num[1] = lo;
          }
	...

For one thing, if HOST_WIDE_INT is 64 bits, then "lo" contains the entire
number and we must not swap, right?

Jeff



More information about the Java mailing list