comparison druntime/src/compiler/dmd/invariant.d @ 759:d3eb054172f9

Added copy of druntime from DMD 2.020 modified for LDC.
author Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
date Tue, 11 Nov 2008 01:52:37 +0100
parents
children
comparison
equal deleted inserted replaced
758:f04dde6e882c 759:d3eb054172f9
1 /*
2 * Placed into the Public Domain
3 * written by Walter Bright
4 * www.digitalmars.com
5 */
6
7 void _d_invariant(Object o)
8 { ClassInfo c;
9
10 //printf("__d_invariant(%p)\n", o);
11
12 // BUG: needs to be filename/line of caller, not library routine
13 assert(o !is null); // just do null check, not invariant check
14
15 c = o.classinfo;
16 do
17 {
18 if (c.classInvariant)
19 {
20 (*c.classInvariant)(o);
21 }
22 c = c.base;
23 } while (c);
24 }