OSDN Git Service

2005-08-10 James A. Morrison <phython@gcc.gnu.org>
authorphython <phython@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 11 Aug 2005 04:21:55 +0000 (04:21 +0000)
committerphython <phython@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 11 Aug 2005 04:21:55 +0000 (04:21 +0000)
        PR c++/23225
        * tree.c (build_pointer_type_for_mode): Robustify.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@102977 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/parse/crash27.C [new file with mode: 0644]
gcc/tree.c

index 8faec78..2c09505 100644 (file)
@@ -1,3 +1,8 @@
+2005-08-10  James A. Morrison  <phython@gcc.gnu.org>
+
+       PR c++/23225
+       * tree.c (build_pointer_type_for_mode): Robustify.
+
 2005-08-10  James E Wilson  <wilson@specifix.com>
 
        * defaults.h, config/alpha/alpha.h, config/ia64/ia64.h
index 7d4d8f2..7af9d40 100644 (file)
@@ -1,7 +1,12 @@
+2005-08-10  James A. Morrison  <phython@gcc.gnu.org>
+
+       PR c++/23225
+       * g++.dg/testsuite/parse/crash27.C: new test.
+
 2005-08-10  Thomas Koenig  <Thomas.Koenig@online.de>
 
        PR libfortran/22143
-       gfortran.dg/shift-kind.f90:  New testcase.
+       gfortran.dg/shift-kind.f90:  New testcase.
 
 2005-08-10  Richard Sandiford  <richard@codesourcery.com>
 
diff --git a/gcc/testsuite/g++.dg/parse/crash27.C b/gcc/testsuite/g++.dg/parse/crash27.C
new file mode 100644 (file)
index 0000000..4d65177
--- /dev/null
@@ -0,0 +1,9 @@
+// Bug: 23225
+
+void Dispatcher()
+        (__builtin_offsetof (ArgsType, largeMsgLen))
+       /* { dg-error "function " "function" { target *-*-* } 4 } */
+       /* { dg-error "expected type" "expected 1" { target *-*-* } 4 } */
+       /* { dg-error "expected `,' before" "expected 2" { target *-*-* } 4 } */
+       /* { dg-error "expected `\\\)" "expected 3" { target *-*-* } 4 } */
+       /* { dg-error "expected ',' or" "expected 4" { target *-*-* } 4 } */
index 39e2f1f..849482d 100644 (file)
@@ -4684,6 +4684,9 @@ build_pointer_type_for_mode (tree to_type, enum machine_mode mode,
 {
   tree t;
 
+  if (to_type == error_mark_node)
+    return error_mark_node;
+
   /* In some cases, languages will have things that aren't a POINTER_TYPE
      (such as a RECORD_TYPE for fat pointers in Ada) as TYPE_POINTER_TO.
      In that case, return that type without regard to the rest of our