bug-gnustep
[Top][All Lists]
Advanced

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

[bug #25720] validateValue:forKey:error broken in base-1.18


From: Michael Johnston
Subject: [bug #25720] validateValue:forKey:error broken in base-1.18
Date: Fri, 27 Feb 2009 11:51:58 +0000
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_6; en-us) AppleWebKit/525.27.1 (KHTML, like Gecko) Version/3.2.1 Safari/525.27.1

URL:
  <http://savannah.gnu.org/bugs/?25720>

                 Summary: validateValue:forKey:error broken in base-1.18
                 Project: GNUstep
            Submitted by: mjohnston
            Submitted on: Fri 27 Feb 2009 11:51:56 AM GMT
                Category: Base/Foundation
                Severity: 3 - Normal
              Item Group: Bug
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

Library version - gnustep-startup-0.22
gcc version - 4.3.2
OS - Fedora Core 10

Expected Behaviour

validateValue:forKey:error: should return YES by default if the receiver
doesn't implement key-value validation for the key.

Actual Behaviour:

validateValue:forKey:error tries to call validate$KEY:error whether or not
the reciver implements the method. This causes an exception to be raised.

Regression:

This problem does not exist in previous version of base.

Reason:

 I think this may be due to a difference in behaviour between using
sel_get_uid (via GSSelectorFromName()) in 1.18)  and sel_get_any_uid used in
previous versions. 

In 1.18 validateValue:forKey:error uses the return value of
GSSelectorFromName to decide whether to obtain a pointer to the method via
methodForSelector: and call it.
However it seems that this function returns a selector regardless of whether
such a method exists or not, whereas previously sel_get_any_uid would return 0
if the selector wasn't valid.

Next methodForSelector: returns a IMP for the (invalid) selector - it never
checks it svalidity as it only expects real selectors. Finally the function
pointer is called and the exception raised.

Possible Solution:

Add a respondsToSelector: call after obtaining the selector.










    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?25720>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/





reply via email to

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