Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge pull request #1461 from AndrejMitrovic/Fix9291

Issue 9291 - ICE on throwing undefined identifier
  • Loading branch information...
commit 1eb2bf2ebf8203ea5fdf7fe92aa946bbde6e9c30 2 parents 98e20bc + 3e585b4
Hara Kenji 9rnsr authored

Showing 2 changed files with 14 additions and 2 deletions. Show diff stats Hide diff stats

  1. +3 2 src/statement.c
  2. +11 0 test/fail_compilation/ice9291.d
5 src/statement.c
@@ -5006,9 +5006,10 @@ Statement *ThrowStatement::semantic(Scope *sc)
5006 5006
5007 5007 int ThrowStatement::blockExit(bool mustNotThrow)
5008 5008 {
5009   - if (mustNotThrow)
  5009 + Type *t = exp->type->toBasetype();
  5010 + if (mustNotThrow && t->ty != Terror)
5010 5011 {
5011   - ClassDeclaration *cd = exp->type->toBasetype()->isClassHandle();
  5012 + ClassDeclaration *cd = t->isClassHandle();
5012 5013 assert(cd);
5013 5014
5014 5015 // Bugzilla 8675
11 test/fail_compilation/ice9291.d
... ... @@ -0,0 +1,11 @@
  1 +/*
  2 +TEST_OUTPUT:
  3 +---
  4 +fail_compilation/ice9291.d(10): Error: undefined identifier F
  5 +---
  6 +*/
  7 +
  8 +void main() nothrow
  9 +{
  10 + throw new F();
  11 +}

0 comments on commit 1eb2bf2

Please sign in to comment.
Something went wrong with that request. Please try again.