This commit is contained in:
Tomas Lindquist Olsen
2008-08-21 15:35:39 +02:00
6 changed files with 93 additions and 23 deletions

View File

@@ -0,0 +1,25 @@
/*
* Placed into the Public Domain
* written by Walter Bright
* www.digitalmars.com
*/
extern(C) void _d_invariant(Object o)
{ ClassInfo c;
//printf("__d_invariant(%p)\n", o);
// BUG: needs to be filename/line of caller, not library routine
assert(o !is null); // just do null check, not invariant check
c = o.classinfo;
do
{
if (c.classInvariant)
{
(*c.classInvariant)(o);
}
c = c.base;
} while (c);
}

View File

@@ -83,6 +83,7 @@ OBJ_BASE= \
memory.bc \
qsort2.bc \
switch.bc \
invariant.bc \
OBJ_UTIL= \
util/console.bc \