gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: KVC weird


From: Wolfgang Lux
Subject: Re: KVC weird
Date: Fri, 17 Sep 2010 10:13:30 +0200

David Wetzel wrote:

Hi,

I am trying to find whats breaking GSWeb on current -base.

The code in GSWApplication+Defaults.m does KVC on a class, not an instance.

[...]

So my wild guess is that [sig numberOfArguments] is wrong.

0 points. The problem really is in -methodSignatureForSelector:, which returns nil rather than the class method's signature. This is due to a recent optimization by David C., which broke the implementation of this method for class methods.

The new fast path of the method uses class_respondsToSelector, but this method checks only for an *instance* method of the given class. So you get false negatives when asking a class object for one of its class methods, as happens in your case, except if there is an instance method with the same name. On the other hand, you get false positives when asking a class object for a class method which it does not implement and if an instance method with the same name exists. This will later lead to a crash in this method -- at least with the old runtime -- when dereferencing the result of GSGetMethod.

Any ideas how to fix that? (other than changing the macros at GSWApplication+Defaults.m)

Until somebody fixes this bug in svn, just revert the patch from r31231 in -base (svn merge -c-31231 should do the job).

Wolfgang



reply via email to

[Prev in Thread] Current Thread [Next in Thread]