D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 8865 - D1: Assertion failure: on line 1166 in interpret.c
Summary: D1: Assertion failure: on line 1166 in interpret.c
Status: RESOLVED WONTFIX
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D1 (retired)
Hardware: All All
: P2 normal
Assignee: Kenji Hara
URL:
Keywords: ice, pull
Depends on:
Blocks:
 
Reported: 2012-10-21 15:04 UTC by Ryuichi OHORI
Modified: 2013-11-24 20:03 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Ryuichi OHORI 2012-10-21 15:04:38 UTC
void main() {}

static int x = f();

static int f()
out // or in, not body
{
label:
    foreach (i; 0..1)
    {
        break label; // doesn't work.
        //break; // works.
        //continue label; // doesn't work.
        //continue; // works.
    }
}
body
{
    return 1;
}

compiling the code above outputs:
> Assertion failure: 'label && label->statement' on line 1166 in file 'interpret.c'
> 
> abnormal program termination
Comment 1 Ryuichi OHORI 2012-10-21 16:23:11 UTC
> the code above
If -release, it compiles.

And below compiles as well:

void main() {}

static int x = f();

static int f()
  out { g(); }
  body { return 1; }

void g()
{
label:
    foreach (i; 0..1)
    {
        continue label;
    }
}
Comment 2 github-bugzilla 2012-10-28 00:35:05 UTC
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/0977ba488d1c7a5257ed79cd0ac4bf41c3a425c5
fix Issue 8865 - Assertion failure: on line 1166 in interpret.c

For CTFE, add prefix to the labels in contracts.

https://github.com/D-Programming-Language/dmd/commit/4c67f3a58c34250d82296f0712afb0b86a6d7ab2
Merge pull request #1232 from 9rnsr/fix8865

Issue 8865 - Assertion failure: on line 1166 in interpret.c
Comment 4 yebblies 2012-10-28 00:35:43 UTC
Fixed D2
Comment 5 Kenji Hara 2013-11-24 20:03:33 UTC
D1 is not supported anymore.