diff options
author | Nicola Pero <nicola.pero@meta-innovation.com> | 2010-12-08 23:46:28 +0000 |
---|---|---|
committer | Nicola Pero <nicola@gcc.gnu.org> | 2010-12-08 23:46:28 +0000 |
commit | 6347cf3119969c89259c269f8eba9c267ff098b8 (patch) | |
tree | ff57e0beed9ef0ff7353af054bd1a49d3e4061e6 /gcc/objc | |
parent | e493bdc219725a41e2c9d5a549fac1bf46c31d07 (diff) | |
download | gcc-6347cf3119969c89259c269f8eba9c267ff098b8.zip gcc-6347cf3119969c89259c269f8eba9c267ff098b8.tar.gz gcc-6347cf3119969c89259c269f8eba9c267ff098b8.tar.bz2 |
In gcc/objc/: 2010-12-08 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/objc/:
2010-12-08 Nicola Pero <nicola.pero@meta-innovation.com>
* objc-act.c (objc_build_throw_stmt): Check that the argument of
@throw is an object and emit an error if not.
In gcc/testsuite/:
2010-12-08 Nicola Pero <nicola.pero@meta-innovation.com>
* objc.dg/exceptions-7.m: New.
* obj-c++.dg/exceptions-7.mm: New.
* obj-c++.dg/exceptions-3.mm: Adjust for new C++ messages.
* obj-c++.dg/exceptions-5.mm: Same change.
From-SVN: r167615
Diffstat (limited to 'gcc/objc')
-rw-r--r-- | gcc/objc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/objc/objc-act.c | 8 |
2 files changed, 13 insertions, 0 deletions
diff --git a/gcc/objc/ChangeLog b/gcc/objc/ChangeLog index 0997727..09cc1f6 100644 --- a/gcc/objc/ChangeLog +++ b/gcc/objc/ChangeLog @@ -1,5 +1,10 @@ 2010-12-08 Nicola Pero <nicola.pero@meta-innovation.com> + * objc-act.c (objc_build_throw_stmt): Check that the argument of + @throw is an object and emit an error if not. + +2010-12-08 Nicola Pero <nicola.pero@meta-innovation.com> + * objc-act.c (objc_finish_foreach_loop): Use error_at() instead of error() when printing an error about the iterating variable or collection not being an object. diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c index f760aad..1b815df 100644 --- a/gcc/objc/objc-act.c +++ b/gcc/objc/objc-act.c @@ -5528,6 +5528,14 @@ objc_build_throw_stmt (location_t loc, tree throw_expr) value that we get from the runtime. */ throw_expr = objc_build_exc_ptr (); } + else if (throw_expr != error_mark_node) + { + if (!objc_type_valid_for_messaging (TREE_TYPE (throw_expr), true)) + { + error_at (loc, "%<@throw%> argument is not an object"); + return error_mark_node; + } + } /* A throw is just a call to the runtime throw function with the object as a parameter. */ |