diff options
author | mrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-01-09 17:55:57 +0000 |
---|---|---|
committer | mrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-01-09 17:55:57 +0000 |
commit | b0954f4059d2978960703854f8ffb4b3b3a1fb7e (patch) | |
tree | f7a3c8630dd13f0857201515e23d52926a7b9a91 /libobjc | |
parent | dba7c78e09851314ee0b1632f3cabddbbaebc60d (diff) | |
download | gcc-b0954f4059d2978960703854f8ffb4b3b3a1fb7e.tar.gz |
2015-01-09 Dimitris Papavasiliou <dpapavas@gmail.com>
* ivars.c: Add a check for classes without instance
variables, which have a NULL ivar list pointer.
2015-01-09 Dimitris Papavasiliou <dpapavas@gmail.com>
* objc.dg/gnu-api-2-class.m: Add a test case
for the above change.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@219396 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libobjc')
-rw-r--r-- | libobjc/ChangeLog | 5 | ||||
-rw-r--r-- | libobjc/ivars.c | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/libobjc/ChangeLog b/libobjc/ChangeLog index 2e2b543b2dc..a3f31b73023 100644 --- a/libobjc/ChangeLog +++ b/libobjc/ChangeLog @@ -1,3 +1,8 @@ +2015-01-09 Dimitris Papavasiliou <dpapavas@gmail.com> + + * ivars.c: Add a check for classes without instance + variables, which have a NULL ivar list pointer. + 2015-01-05 Jakub Jelinek <jakub@redhat.com> Update copyright years. diff --git a/libobjc/ivars.c b/libobjc/ivars.c index dd145360e39..910a09828db 100644 --- a/libobjc/ivars.c +++ b/libobjc/ivars.c @@ -179,7 +179,7 @@ struct objc_ivar ** class_copyIvarList (Class class_, unsigned int *numberOfRetu struct objc_ivar **returnValue = NULL; struct objc_ivar_list* ivar_list; - if (class_ == Nil || CLS_IS_IN_CONSTRUCTION (class_)) + if (class_ == Nil || CLS_IS_IN_CONSTRUCTION (class_) || !class_->ivars) { if (numberOfReturnedIvars) *numberOfReturnedIvars = 0; |