D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 4873 - Assertion failure: '0' on line 1483 in file 'expression.c'
Summary: Assertion failure: '0' on line 1483 in file 'expression.c'
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86 Windows
: P2 normal
Assignee: No Owner
URL:
Keywords: ice-on-invalid-code, patch
Depends on:
Blocks:
 
Reported: 2010-09-15 14:12 UTC by anonymous4
Modified: 2010-10-08 14:45 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 anonymous4 2010-09-15 14:12:39 UTC
--- 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 anonymous4 2010-09-15 14:13:32 UTC
workaround: remove assert
Comment 2 Don 2010-10-05 12:30:28 UTC
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 Walter Bright 2010-10-08 14:45:08 UTC
http://www.dsource.org/projects/dmd/changeset/711