ObjFW  Diff

Differences From Artifact [69ac875773]:

To Artifact [864eafb36e]:


232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
	if ((oldimp = method_get_imp(method)) == (IMP)0 || newimp == (IMP)0)
		@throw [OFInvalidArgumentException newWithClass: self
						       selector: _cmd];

	method->method_imp = newimp;

	/* Update the dtable if necessary */
	if (sarray_get_safe(self->class_pointer->dtable,
	    (sidx)method->method_name->sel_id))
		sarray_at_put_safe(self->class_pointer->dtable,
		    (sidx)method->method_name->sel_id, method->method_imp);

	return oldimp;
#endif
}

+  (IMP)replaceClassMethod: (SEL)selector







|

|







232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
	if ((oldimp = method_get_imp(method)) == (IMP)0 || newimp == (IMP)0)
		@throw [OFInvalidArgumentException newWithClass: self
						       selector: _cmd];

	method->method_imp = newimp;

	/* Update the dtable if necessary */
	if (sarray_get_safe(((Class)self->class_pointer)->dtable,
	    (sidx)method->method_name->sel_id))
		sarray_at_put_safe(((Class)self->class_pointer)->dtable,
		    (sidx)method->method_name->sel_id, method->method_imp);

	return oldimp;
#endif
}

+  (IMP)replaceClassMethod: (SEL)selector
285
286
287
288
289
290
291

292
293
294
295
296
297
298
299
300
	if ((oldimp = method_get_imp(method)) == (IMP)0 || newimp == (IMP)0)
		@throw [OFInvalidArgumentException newWithClass: self
						       selector: _cmd];

	method->method_imp = newimp;

	/* Update the dtable if necessary */

	if (sarray_get_safe(self->dtable, (sidx)method->method_name->sel_id))
		sarray_at_put_safe(self->dtable,
		    (sidx)method->method_name->sel_id, method->method_imp);

	return oldimp;
#endif
}

+  (IMP)replaceInstanceMethod: (SEL)selector







>
|
|







285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
	if ((oldimp = method_get_imp(method)) == (IMP)0 || newimp == (IMP)0)
		@throw [OFInvalidArgumentException newWithClass: self
						       selector: _cmd];

	method->method_imp = newimp;

	/* Update the dtable if necessary */
	if (sarray_get_safe(((Class)self)->dtable,
	    (sidx)method->method_name->sel_id))
		sarray_at_put_safe(((Class)self)->dtable,
		    (sidx)method->method_name->sel_id, method->method_imp);

	return oldimp;
#endif
}

+  (IMP)replaceInstanceMethod: (SEL)selector