This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/50858] [4.7 Regression] segfault at ../../gcc/libiberty/hashtab.c:981


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)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]