[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
NSXMLNode ivar type
From: |
David Chisnall |
Subject: |
NSXMLNode ivar type |
Date: |
Tue, 20 Mar 2018 14:50:43 +0000 |
Hello the list,
I am working on the new ObjC ABI and one of the changes I have made is to
include the type encoding in the ivar offset variable. This protects against
type confusion by causing linker failures when an instance variable is
referenced with the wrong type (which can happen if it’s in a library that
changes and someone forgets to bump the SONAME).
Unfortunately, I have found that -base doesn’t build because it uses some
complex preprocessor logic to change the type of NSXMLNode’s node ivar
depending on which subclass you are using. This is quite dangerous because,
although the types have a common prefix, the version used in the root is not a
prefix of the others and so it’s possible for type confusion if someone
modifies NSXMLNode without realising how the subclasses use this.
Does anyone object if I commit a patch that turns this into a union?
David
- NSXMLNode ivar type,
David Chisnall <=