Skip to content

Commit

Permalink
fix bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
lukyang committed Aug 7, 2023
1 parent 6ed7142 commit 5abb5da
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
2 changes: 1 addition & 1 deletion MangoFix.podspec
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
9 changes: 0 additions & 9 deletions MangoFix/Compiler/AST/MFTypeSpecifier.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
9 changes: 7 additions & 2 deletions MangoFix/Execute/eval.m
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 5abb5da

Please sign in to comment.