summaryrefslogtreecommitdiff
path: root/MLKSymbol.m
diff options
context:
space:
mode:
authorMatthias Andreas Benkard <matthias@benkard.de>2008-06-17 21:20:42 +0200
committerMatthias Andreas Benkard <matthias@benkard.de>2008-06-17 21:20:42 +0200
commit164e403a974165af103fa072d0f14e2e256153be (patch)
tree17aa5feae4fef9eebeed7e30efd5a9e20b1d1c5d /MLKSymbol.m
parentb11b87db720955acae99a558ef18dd5b6995022d (diff)
MLKDynamicContext#+initialize: Fix various sources of crashes.
Diffstat (limited to 'MLKSymbol.m')
-rw-r--r--MLKSymbol.m26
1 files changed, 26 insertions, 0 deletions
diff --git a/MLKSymbol.m b/MLKSymbol.m
index 1cab004..73d418a 100644
--- a/MLKSymbol.m
+++ b/MLKSymbol.m
@@ -27,9 +27,19 @@
self = [super init];
ASSIGN (name, aName);
ASSIGN (homePackage, aPackage);
+ real_identity = nil;
return self;
}
+-(id) copyWithZone:(NSZone *)zone
+{
+ MLKSymbol *copy = [MLKSymbol allocWithZone:zone];
+ ASSIGN (copy->name, name);
+ ASSIGN (copy->homePackage, homePackage);
+ ASSIGN (copy->real_identity, self);
+ return copy;
+}
+
-(NSString *) name
{
return name;
@@ -53,6 +63,22 @@
return [NSString stringWithFormat:@"|%@|", name];
}
+-(BOOL) isEqual:(id)object
+{
+ if (object == self)
+ return YES;
+
+ if (!([object isKindOfClass:[MLKSymbol class]]))
+ return NO;
+
+ return ((((MLKSymbol *)object)->real_identity
+ ? ((MLKSymbol *)object)->real_identity
+ : (MLKSymbol *)object)
+ == ((self->real_identity != nil
+ ? self->real_identity
+ : self)));
+}
+
-(void) dealloc
{
RELEASE (name);