D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 6871 - [minimal testcase] expression.c:1432: virtual dinteger_t IntegerExp::toInteger(): Assertion `0' failed
Summary: [minimal testcase] expression.c:1432: virtual dinteger_t IntegerExp::toIntege...
Status: RESOLVED INVALID
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D1 (retired)
Hardware: x86 Linux
: P2 normal
Assignee: No Owner
URL:
Keywords: ice-on-invalid-code
Depends on:
Blocks:
 
Reported: 2011-11-01 04:15 UTC by Leandro Lucarella
Modified: 2011-11-01 04:29 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Leandro Lucarella 2011-11-01 04:15:25 UTC
This is in DMD 1.071:

$ cat t.d
void f() {
    for (int i = 0; i < x.length; i++) {
    }
}
$ dmd -c t.d
t.d(2): Error: undefined identifier x, did you mean function f?
_error_ 0x8edf468
dmd: expression.c:1432: virtual dinteger_t IntegerExp::toInteger(): Assertion `0' failed.
Aborted
Comment 1 Leandro Lucarella 2011-11-01 04:21:42 UTC
An even simpler testcase:

void f() {
    while (x.length) {
    }
}
Comment 2 Leandro Lucarella 2011-11-01 04:22:11 UTC
BTW, compiling DMD in "debug mode" hides the assertion :S
Comment 3 Leandro Lucarella 2011-11-01 04:29:45 UTC
OK, it seems that only the makefile is broken, after rebuilding all DMD I can't reproduce the bug anymore.

I guess some files weren't rebuilt after I updated the git repo and that's what was causing the problem.