re PR d/90560 (ICE in visit, at d/dmd/dcast.c:1872)
authorIain Buclaw <ibuclaw@gcc.gnu.org>
Sun, 16 Jun 2019 07:49:43 +0000 (07:49 +0000)
committerIain Buclaw <ibuclaw@gcc.gnu.org>
Sun, 16 Jun 2019 07:49:43 +0000 (07:49 +0000)
PR d/90560
d/dmd: Merge upstream dmd c6887d9bb

Fixes segmentation fault in castTo::CastTo::visit.

Reviewed-on: https://github.com/dlang/dmd/pull/10007

From-SVN: r272348

gcc/d/dmd/MERGE
gcc/d/dmd/mtype.c
gcc/testsuite/gdc.test/fail_compilation/fail19890a.d [new file with mode: 0644]
gcc/testsuite/gdc.test/fail_compilation/fail19890b.d [new file with mode: 0644]

index 36f9aa9c241275b841ba211b7af98b9faab3cde9..3e3e718c11b295fb3e52e661e7395ef340885ace 100644 (file)
@@ -1,4 +1,4 @@
-b0cd591770fefb4db6eaba89b7a548ef1e980f5c
+c6887d9bbbe7b68e03ba3bccbf61432c1b369386
 
 The first line of this file holds the git revision number of the last
 merge done from the dlang/dmd repository.
index 1757b498debb7af6e0b23ea1b645ab1485355803..2b1c5a197e24d95bd3ebe4966ec08a972026fa46 100644 (file)
@@ -4134,8 +4134,7 @@ Type *TypeSArray::semantic(Loc loc, Scope *sc)
              * when the bottom of element type is opaque.
              */
         }
-        else if (tbn->isintegral() ||
-                 tbn->isfloating() ||
+        else if (tbn->isTypeBasic() ||
                  tbn->ty == Tpointer ||
                  tbn->ty == Tarray ||
                  tbn->ty == Tsarray ||
diff --git a/gcc/testsuite/gdc.test/fail_compilation/fail19890a.d b/gcc/testsuite/gdc.test/fail_compilation/fail19890a.d
new file mode 100644 (file)
index 0000000..57c4caf
--- /dev/null
@@ -0,0 +1,7 @@
+// PERMUTE_ARGS:
+/*
+---
+fail_compilation/fail19890a.d(8): Error: `void[/^[0-9]+(LU)?$/]` size 1 * /^[0-9]+$/ exceeds 0x7fffffff size limit for static array
+---
+*/
+void[] f = cast(void[-1]) "a";
diff --git a/gcc/testsuite/gdc.test/fail_compilation/fail19890b.d b/gcc/testsuite/gdc.test/fail_compilation/fail19890b.d
new file mode 100644 (file)
index 0000000..a9b1874
--- /dev/null
@@ -0,0 +1,7 @@
+// PERMUTE_ARGS:
+/*
+---
+fail_compilation/fail19890b.d(8): Error: `void[/^[0-9]+(LU)?$/]` size 1 * /^[0-9]+$/ exceeds 0x7fffffff size limit for static array
+---
+*/
+void[] f = cast(void[-2]) "a";