Bug 4873 – Assertion failure: '0' on line 1483 in file 'expression.c'

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2010-09-15T14:12:00Z
Last change time
2010-10-08T14:45:08Z
Keywords
ice-on-invalid-code, patch
Assigned to
nobody
Creator
dfj1esp02

Comments

Comment #0 by dfj1esp02 — 2010-09-15T14:12:39Z
--- test.d --- struct HANDLE { size_t Value; this(void *ptrValue) { Value=ptrValue; } } enum HANDLE INVALID_HANDLE_VALUE = HANDLE(-1); static assert(INVALID_HANDLE_VALUE.Value == -1); class File { HANDLE Handle=INVALID_HANDLE_VALUE; } --- >dmd -c test.d -w -o- -debug --- e = 00A547EC, ty = 37 _error_ 009E16D8 Assertion failure: '0' on line 1483 in file 'expression.c' abnormal program termination --- Digital Mars D Compiler v2.048
Comment #1 by dfj1esp02 — 2010-09-15T14:13:32Z
workaround: remove assert
Comment #2 by clugdbug — 2010-10-05T12:30:28Z
PATCH: staticassert.c, line 58. void StaticAssert::semantic2(Scope *sc) { Expression *e; //printf("StaticAssert::semantic2() %s\n", toChars()); e = exp->semantic(sc); + if (e->op == TOKerror) + return; e = e->optimize(WANTvalue | WANTinterpret); if (e->isBool(FALSE))
Comment #3 by bugzilla — 2010-10-08T14:45:08Z