]> git.llucax.com Git - software/druntime.git/blob - src/compiler/dmd/invariant.d
No longer default-initializing a buffer which is immediately set via a function call.
[software/druntime.git] / src / compiler / dmd / invariant.d
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 }