diff options
-rw-r--r-- | MLKDynamicContext.m | 20 | ||||
-rw-r--r-- | MLKRoot.m | 12 | ||||
-rw-r--r-- | MLKStream.m | 5 |
3 files changed, 16 insertions, 21 deletions
diff --git a/MLKDynamicContext.m b/MLKDynamicContext.m index a6ffcca..55d6c4e 100644 --- a/MLKDynamicContext.m +++ b/MLKDynamicContext.m @@ -316,13 +316,11 @@ static MLKDynamicContext *global_context; { NS_DURING { - return [_restarts valueForSymbol:symbol]; + NS_VALUERETURN ([_restarts valueForSymbol:symbol], id); } NS_HANDLER { - if ([[localException name] isEqualToString: @"MLKUnboundVariableError"]) - NS_VALUERETURN (nil, id); - else + if (![[localException name] isEqualToString: @"MLKUnboundVariableError"]) [localException raise]; } NS_ENDHANDLER; @@ -335,15 +333,13 @@ static MLKDynamicContext *global_context; NS_DURING { if (_activeHandlerEnvironment) - return [[_activeHandlerEnvironment parent] valueForSymbol:symbol]; + NS_VALUERETURN ([[_activeHandlerEnvironment parent] valueForSymbol:symbol], id); else - return [_conditionHandlers valueForSymbol:symbol]; + NS_VALUERETURN ([_conditionHandlers valueForSymbol:symbol], id); } NS_HANDLER { - if ([[localException name] isEqualToString: @"MLKUnboundVariableError"]) - NS_VALUERETURN (nil, id); - else + if (![[localException name] isEqualToString: @"MLKUnboundVariableError"]) [localException raise]; } NS_ENDHANDLER; @@ -355,13 +351,11 @@ static MLKDynamicContext *global_context; { NS_DURING { - return [_catchTags valueForSymbol:symbol]; + NS_VALUERETURN ([_catchTags valueForSymbol:symbol], id); } NS_HANDLER { - if ([[localException name] isEqualToString: @"MLKUnboundVariableError"]) - NS_VALUERETURN (nil, id); - else + if (![[localException name] isEqualToString: @"MLKUnboundVariableError"]) [localException raise]; } NS_ENDHANDLER; @@ -77,17 +77,23 @@ static id stringify (id thing) NSMutableString *methodName; NSArray *result; SEL selector; + BOOL nothing_found; + + nothing_found = NO; NS_DURING { if ([sys findSymbol:[name name]] != name) - return nil; + NS_VALUERETURN (nil, NSArray *); } NS_HANDLER { - NS_VALUERETURN (nil, NSArray *); + nothing_found = YES; } - NS_ENDHANDLER + NS_ENDHANDLER; + + if (nothing_found) + return nil; invocation = [NSInvocation invocationWithMethodSignature:signature]; diff --git a/MLKStream.m b/MLKStream.m index d130520..cb8869c 100644 --- a/MLKStream.m +++ b/MLKStream.m @@ -133,11 +133,6 @@ } NS_HANDLER { - // For some reason, NS_VALUERETURN (YES, BOOL) causes warnings of - // the following kind on the Apple runtime: - // - // *** Attempt to remove unrecognized exception handler 0xbfff6200 - // if ([[localException name] isEqual:@"MLKStreamError"]) eofp = YES; else |