ObjFW  Diff

Differences From Artifact [cf2379237f]:

To Artifact [505a6ff075]:


64
65
66
67
68
69
70
71

72
73
74
75
76
77
78
79

80
81
82

83
84
85

86
87
88
89
90
91
92
93

94
95
96

97
98
99
100
101
102
103
64
65
66
67
68
69
70

71
72
73
74
75
76
77
78

79
80
81

82
83
84

85
86
87
88
89
90
91
92

93
94
95

96
97
98
99
100
101
102
103







-
+







-
+


-
+


-
+







-
+


-
+







static void
test(id self, SEL _cmd)
{
	success = true;
}

@implementation ForwardingTest
+ (bool)resolveClassMethod: (SEL)selector
+ (BOOL)resolveClassMethod: (SEL)selector
{
	forwardings++;

	if (sel_isEqual(selector, @selector(test))) {
		[self replaceClassMethod: @selector(test)
		      withImplementation: (IMP)test
			    typeEncoding: "v#:"];
		return true;
		return YES;
	}

	return false;
	return NO;
}

+ (bool)resolveInstanceMethod: (SEL)selector
+ (BOOL)resolveInstanceMethod: (SEL)selector
{
	forwardings++;

	if (sel_isEqual(selector, @selector(test))) {
		[self replaceInstanceMethod: @selector(test)
			 withImplementation: (IMP)test
			       typeEncoding: "v@:"];
		return true;
		return YES;
	}

	return false;
	return NO;
}

- (id)forwardingTargetForSelector: (SEL)selector
{
	/*
	 * Do some useless calculations in as many registers as possible to
	 * check if the arguments are properly saved and restored.