aboutsummaryrefslogtreecommitdiff
path: root/gcc/d
diff options
context:
space:
mode:
authorIain Buclaw <ibuclaw@gcc.gnu.org>2019-06-16 07:50:31 +0000
committerIain Buclaw <ibuclaw@gcc.gnu.org>2019-06-16 07:50:31 +0000
commit5767d76f8f1ee56b68e794ccb65a720a8a3581c7 (patch)
treed78be0616d576e31d61e0e3aaffee59fc31056ff /gcc/d
parentb0a55e6657cbb934837b293a9ea2810b1a74c7e0 (diff)
downloadgcc-5767d76f8f1ee56b68e794ccb65a720a8a3581c7.zip
gcc-5767d76f8f1ee56b68e794ccb65a720a8a3581c7.tar.gz
gcc-5767d76f8f1ee56b68e794ccb65a720a8a3581c7.tar.bz2
re PR d/90863 (ICE in StatementSemanticVisitor::visit, at d/dmd/statementsem.c:1992)
PR d/90863 d/dmd: Merge upstream dmd 6e44734cc Fixes segmentation fault in StatementSemanticVisitor::visit. Reviewed-on: https://github.com/dlang/dmd/pull/10033 From-SVN: r272352
Diffstat (limited to 'gcc/d')
-rw-r--r--gcc/d/dmd/MERGE2
-rw-r--r--gcc/d/dmd/blockexit.c2
-rw-r--r--gcc/d/dmd/statementsem.c4
3 files changed, 5 insertions, 3 deletions
diff --git a/gcc/d/dmd/MERGE b/gcc/d/dmd/MERGE
index 4111fc9..0620a5b 100644
--- a/gcc/d/dmd/MERGE
+++ b/gcc/d/dmd/MERGE
@@ -1,4 +1,4 @@
-7afcc60c30554e452eacdfbefc4951ebf601fccd
+6e44734ccbeb78252a52e129a67fefb313679948
The first line of this file holds the git revision number of the last
merge done from the dlang/dmd repository.
diff --git a/gcc/d/dmd/blockexit.c b/gcc/d/dmd/blockexit.c
index e9d3f10..c3b60b8 100644
--- a/gcc/d/dmd/blockexit.c
+++ b/gcc/d/dmd/blockexit.c
@@ -496,6 +496,8 @@ int blockExit(Statement *s, FuncDeclaration *func, bool mustNotThrow)
}
};
+ if (!s)
+ return BEfallthru;
BlockExit be(func, mustNotThrow);
s->accept(&be);
return be.result;
diff --git a/gcc/d/dmd/statementsem.c b/gcc/d/dmd/statementsem.c
index 167836c..143864dc6 100644
--- a/gcc/d/dmd/statementsem.c
+++ b/gcc/d/dmd/statementsem.c
@@ -2035,7 +2035,7 @@ public:
ss->_body = semantic(ss->_body, sc);
sc->noctor--;
- if (conditionError || ss->_body->isErrorStatement())
+ if (conditionError || (ss->_body && ss->_body->isErrorStatement()))
goto Lerror;
// Resolve any goto case's with exp
@@ -2111,7 +2111,7 @@ public:
{
ss->hasNoDefault = 1;
- if (!ss->isFinal && !ss->_body->isErrorStatement())
+ if (!ss->isFinal && (!ss->_body || !ss->_body->isErrorStatement()))
ss->error("switch statement without a default; use 'final switch' or add 'default: assert(0);' or add 'default: break;'");
// Generate runtime error if the default is hit