diff --git a/MangoFix.podspec b/MangoFix.podspec index 6e4b698..747c68e 100644 --- a/MangoFix.podspec +++ b/MangoFix.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "MangoFix" -s.version = "1.5.3" +s.version = "1.5.4" s.summary = "MangoFix" s.description = <<-DESC Mango is a DSL which syntax is very similar to Objective-C,Mango is also an iOS App hotfix SDK. You can use Mango method replace any Objective-C method. diff --git a/MangoFix/Compiler/AST/MFTypeSpecifier.m b/MangoFix/Compiler/AST/MFTypeSpecifier.m index 5f31b12..54b884c 100644 --- a/MangoFix/Compiler/AST/MFTypeSpecifier.m +++ b/MangoFix/Compiler/AST/MFTypeSpecifier.m @@ -32,15 +32,6 @@ - (const char *)typeEncoding{ return _typeEncoding; } - if (self.annotationList) { - for (MFAnnotation *annotation in self.annotationList) { - if ([annotation.name isEqualToString:@"@Signature"]) { - _typeEncoding = annotation.expr.cstringValue; - return _typeEncoding; - } - } - } - if (self.typeKind == MF_TYPE_STRUCT || self.typeKind == MF_TYPE_STRUCT_LITERAL) { MFStructDeclareTable *table = [MFStructDeclareTable shareInstance]; _typeEncoding = [table getStructDeclareWithName:self.structName].typeEncoding; diff --git a/MangoFix/Execute/eval.m b/MangoFix/Execute/eval.m index 282193a..0914325 100644 --- a/MangoFix/Execute/eval.m +++ b/MangoFix/Execute/eval.m @@ -1698,8 +1698,13 @@ static void eval_function_call_expression(MFInterpreter *inter, MFScopeChain *sc [inter.stack push:retValue]; }else{ const char *blockTypeEncoding = [MFBlock typeEncodingForBlock:callee.c2objectValue]; - if (!blockTypeEncoding) { - blockTypeEncoding = [callee.type typeEncoding]; + if (!blockTypeEncoding && callee.type.annotationList) { + NSArray *annotationList = callee.type.annotationList; + for (MFAnnotation *annotation in annotationList) { + if ([annotation.name isEqualToString:@"@Signature"]) { + blockTypeEncoding = annotation.expr.cstringValue; + } + } } if (!blockTypeEncoding) {