summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0328-In-libobjc.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0328-In-libobjc.patch')
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0328-In-libobjc.patch81
1 files changed, 81 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0328-In-libobjc.patch b/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0328-In-libobjc.patch
new file mode 100644
index 0000000000..7e2287cb3b
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0328-In-libobjc.patch
@@ -0,0 +1,81 @@
1From 30ac84569e48f4807970260f04821bf31f42b66c Mon Sep 17 00:00:00 2001
2From: nicola <nicola@138bc75d-0d04-0410-961f-82ee72b054a4>
3Date: Wed, 25 May 2011 09:07:57 +0000
4Subject: [PATCH] In libobjc/:
5 2011-05-25 Nicola Pero <nicola.pero@meta-innovation.com>
6
7 Backport from mainline
8 2011-05-24 Nicola Pero <nicola.pero@meta-innovation.com>
9
10 PR libobjc/48177
11 * selector.c (__sel_register_typed_name): Use sel_types_match()
12 instead of strcmp() to compare selector types (Suggestion by
13 Richard Frith-Macdonald <rfm@gnu.org>).
14
15In gcc/testsuite/:
162011-05-25 Nicola Pero <nicola.pero@meta-innovation.com>
17
18 Backport from mainline
19 2011-05-24 Nicola Pero <nicola.pero@meta-innovation.com>
20
21 PR libobjc/48177
22 * objc.dg/pr48177.m: New testcase.
23
24
25git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_6-branch@174176 138bc75d-0d04-0410-961f-82ee72b054a4
26
27new file mode 100644
28index 0000000..0d7ff29
29--- /dev/null
30+++ b/gcc/testsuite/objc.dg/pr48177.m
31@@ -0,0 +1,35 @@
32+/* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, May 2011. */
33+/* { dg-do run } */
34+/* { dg-skip-if "No API#2 pre-Darwin9" { *-*-darwin[5-8]* } { "-fnext-runtime" } { "" } } */
35+
36+#include <objc/runtime.h>
37+#include <stdlib.h>
38+
39+int main(int argc, void **args)
40+{
41+#ifdef __GNU_LIBOBJC__
42+ /* This special test tests that, if you have a selector already
43+ registered in the runtime with full type information, you can use
44+ sel_registerTypedName() to get it even if you specify the type
45+ with incorrect argframe information. This is helpful as
46+ selectors generated by the compiler (which have correct argframe
47+ information) are usually registered before hand-written ones
48+ (which often have incorrect argframe information, but need the
49+ correct one).
50+
51+ Note that in this hand-written test, even the type information of
52+ the first selector may be wrong (on this machine); but that's OK
53+ as we'll never actually use the selectors. */
54+ SEL selector1 = sel_registerTypedName ("testMethod", "i8@0:4");
55+ SEL selector2 = sel_registerTypedName ("testMethod", "i8@8:8");
56+
57+ /* We compare the selectors using ==, not using sel_isEqual(). This
58+ is because we are testing internals of the runtime and we know
59+ that in the current implementation they should be identical if
60+ the stuff is to work as expected. Don't do this at home. */
61+ if (selector1 != selector2)
62+ abort ();
63+#endif
64+
65+ return 0;
66+}
67index 80d2d80..628b4f6 100644
68--- a/libobjc/selector.c
69+++ b/libobjc/selector.c
70@@ -597,7 +597,7 @@ __sel_register_typed_name (const char *name, const char *types,
71 return s;
72 }
73 }
74- else if (! strcmp (s->sel_types, types))
75+ else if (sel_types_match (s->sel_types, types))
76 {
77 if (orig)
78 {
79--
801.7.0.4
81