Changeset 7450


Ignore:
Timestamp:
Oct 15, 2007, 6:43:44 PM (14 years ago)
Author:
gb
Message:

When reviving ObjC classes, zero out the class/metaclass pointers of each
class if they were "dead macptrs". We don't want to revive a pointer at
its old address, since that may accidentally conflict with some other
class's current address, causing grief and dispair and much gnashing of
teeth in GDB.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ccl/objc-bridge/objc-runtime.lisp

    r7301 r7450  
    602602             (meta-id (objc-class-id->objc-metaclass-id i))
    603603             (m (id->objc-metaclass meta-id)))
    604         (%revive-macptr c)
    605         (%revive-macptr m)
     604        (unless (typep c 'macptr)
     605          (%revive-macptr c)
     606          (%setf-macptr c (%null-ptr)))
     607        (unless (typep m 'macptr)
     608          (%revive-macptr m)
     609          (%setf-macptr m (%null-ptr)))
    606610        (unless (splay-tree-get class-map c)
    607611          (%set-pointer-to-objc-class-address (objc-class-id-foreign-name i) c)
Note: See TracChangeset for help on using the changeset viewer.