This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Follow up : Serious bug in _Jv_InitPrimClass -- more of a procedural thing



First, I think I see my problem. At


#2 0x04018a28 in java::lang::Runtime::insertSystemProperties(java::util::Properties*) (newprops=0x1024b8) at /cygdrive/c/home/gnu/gcc-3.3.1-2/libjava/java/lang/natRuntime.cc:573

I'm only in this code because _Jv_Jar_Class_Path is null. This must not be the case for everyone else on the planet, or someone would have seen this problem before. I'll see about getting it set to something useful.

Having said that, it seems that if arbitary paths can do this sort of thing, then it would be much safer to get the call to _Jv_NewArrayClass out of _Jv_InitPrimClass and do something like

_Jv_CreateJavaVM (void* /*vm_args*/)
{
  ...

 /* Initialize built-in classes to represent primitive TYPEs. */
 _Jv_InitPrimClass (&_Jv_byteClass,    "byte",    'B', 1);
 _Jv_InitPrimClass (&_Jv_shortClass,   "short",   'S', 2);
 _Jv_InitPrimClass (&_Jv_intClass,     "int",     'I', 4);
 _Jv_InitPrimClass (&_Jv_longClass,    "long",    'J', 8);
 _Jv_InitPrimClass (&_Jv_booleanClass, "boolean", 'Z', 1);
 _Jv_InitPrimClass (&_Jv_charClass,    "char",    'C', 2);
 _Jv_InitPrimClass (&_Jv_floatClass,   "float",   'F', 4);
 _Jv_InitPrimClass (&_Jv_doubleClass,  "double",  'D', 8);
 _Jv_InitPrimClass (&_Jv_voidClass,    "void",    'V', 0);

/* Initialize built-in classes to represent primitive array TYPEs. */
_Jv_NewArrayClass (&_Jv_byteClass, NULL, (_Jv_VTable *) &_Jv_byteVTable);
_Jv_NewArrayClass (&_Jv_shortClass, NULL,(_Jv_VTable *) &_Jv_shortVTable);
_Jv_NewArrayClass (&_Jv_intClass, NULL, (_Jv_VTable *) &_Jv_intVTable);
_Jv_NewArrayClass (&_Jv_longClass, NULL, (_Jv_VTable *) &_Jv_longVTable);
_Jv_NewArrayClass (&_Jv_booleanClass, NULL, (_Jv_VTable *) &_Jv_booleanVTable);
_Jv_NewArrayClass (&_Jv_charClass, NULL, (_Jv_VTable *) &_Jv_charVTable);
_Jv_NewArrayClass (&_Jv_floatClass, NULL, (_Jv_VTable *) &_Jv_floatVTable);
_Jv_NewArrayClass (&_Jv_doubleClass, NULL, (_Jv_VTable *) &_Jv_doubleVTable);


 // Turn stack trace generation off while creating exception objects.
 _Jv_InitClass (&java::lang::VMThrowable::class$);

....

Regards,
Peter Blemel

_________________________________________________________________
Is your PC infected? Get a FREE online computer virus scan from McAfee® Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]