This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/50858] [4.7 Regression] segfault at ../../gcc/libiberty/hashtab.c:981
- From: "paolo.carlini at oracle dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 25 Oct 2011 00:55:26 +0000
- Subject: [Bug c++/50858] [4.7 Regression] segfault at ../../gcc/libiberty/hashtab.c:981
- Auto-submitted: auto-generated
- References: <bug-50858-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50858
--- Comment #8 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-10-25 00:55:26 UTC ---
This patchlet avoids the ICE and passes the testsuite:
Index: typeck.c
===================================================================
--- typeck.c (revision 180413)
+++ typeck.c (working copy)
@@ -510,8 +510,12 @@ composite_pointer_type_r (tree t1, tree t2,
&& TREE_CODE (pointee2) == POINTER_TYPE)
|| (TYPE_PTR_TO_MEMBER_P (pointee1)
&& TYPE_PTR_TO_MEMBER_P (pointee2)))
- result_type = composite_pointer_type_r (pointee1, pointee2, operation,
- complain);
+ {
+ result_type = composite_pointer_type_r (pointee1, pointee2, operation,
+ complain);
+ if (result_type == error_mark_node)
+ return error_mark_node;
+ }
else
{
if (complain & tf_error)