Changeset 329


Ignore:
Timestamp:
Apr 13, 2008, 10:06:05 PM (17 years ago)
Author:
cinc
Message:

Fixed of by one array access bug showing only on Darwin in release builds for some strange reason. Fixed two warnings.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/nom/src/nombuildclass.c

    r326 r329  
    378378    entries[] contain copies of the ClassDataStruct and thus the proc addresses of the static methods.
    379379    */
    380   mem=(char*)nClass->mtab; /* Target address */
     380  mem=(guint8*)nClass->mtab; /* Target address */
    381381  memcpy(mem, ncpParent->mtab, ncpParent->mtab->mtabSize); /* copy parent mtab with all proc addresses */
    382382#ifdef DEBUG_NOMBUILDCLASS
     
    386386#endif
    387387
    388   mem=((char*)nClass->mtab) + ncpParent->mtab->mtabSize; /* points right after the parent mtab now in
     388  mem=((guint8*)nClass->mtab) + ncpParent->mtab->mtabSize; /* points right after the parent mtab now in
    389389                                                           our private struct */
    390390  /* Add class struct of this class. This includes the proc adresses. */
     
    432432{
    433433  NOMClassPriv *ncpParent=NULL;
     434
     435  DBG_NOMBUILDCLASS(TRUE, "Find NOMClassPriv for %s %x\n", chrClassName, chrClassName);
    434436
    435437  if(NULL==NOMClassMgrObject){
     
    521523  /* Get parent class if any */
    522524  if(NULL!=sci->chrParentClassNames){
    523     ncpParent=priv_getClassFromName(sci->chrParentClassNames[sci->ulNumParentsInChain]);
     525    ncpParent=priv_getClassFromName(sci->chrParentClassNames[sci->ulNumParentsInChain-1]);
    524526  }/* nomIdAllParents */
    525527  else
     
    908910  for(a=0;a<sci->ulNumStaticMethods;a++) {
    909911    *sci->nomSMethods[a].nomMAddressInClassData=(void*)sci->nomSMethods[a].nomMethod; /*  Address to place the resolved function address in see *.ih files. */
    910 #ifdef _DEBUG_NOMBUILDCLASS
     912#ifdef DEBUG_NOMBUILDCLASS
    911913    nomPrintf("  static method: %s, %lx\n", *sci->nomSMethods[a].chrMethodDescriptor, sci->nomSMethods[a].nomMethod);
    912914    nomPrintf("%d: %d: method: %x %s (classdata addr. %x) (Fill static class struct with procs)\n",
     
    915917  }
    916918
    917 #ifdef _DEBUG_NOMBUILDCLASS
     919#ifdef DEBUG_NOMBUILDCLASS
    918920  nomPrintf("%d: Dumping the filled classdata structure:\n", __LINE__);
    919921  _dumpClassDataStruct(sci->nomCds, sci->ulNumStaticMethods);
     
    941943#warning !!!!! Change this when nomId is a GQuark !!!!!
    942944# endif
    943     nomPrintf("%d: About to search parent %s...\n", __LINE__, **(sci->nomIdAllParents));
    944 #endif
    945 
    946     ncpParent=priv_getClassFromName(sci->chrParentClassNames[sci->ulNumParentsInChain]);
     945    nomPrintf("%d: About to search parent %s (%d)...\n", __LINE__, **(sci->nomIdAllParents), sci->ulNumParentsInChain);
     946    nomPrintf("%d: About to search parent %s (%s)...\n", __LINE__, **(sci->nomIdAllParents),
     947              sci->chrParentClassNames[0]);
     948#endif
     949
     950    ncpParent=priv_getClassFromName(sci->chrParentClassNames[sci->ulNumParentsInChain-1]);
    947951
    948952#if 0
Note: See TracChangeset for help on using the changeset viewer.