void main() {
        pragma(msg,"bar".sizeof);
        size_t foo = 12;
        switch(foo) {
        case hashOf("bar"):
                break;
        }
}

I'm pretty sure this worked before. (htmld is full of these hash case statements.) But now, when I try to compile, it spits out errors like

druntime/import/object.d(3173): Error: pointer slice [0..16] exceeds allocated memory block [0..3] druntime/import/object.d(3173): called from here: hashOf(& arg[0..16], seed)
test.d(5):        called from here: hashOf("bar", 0LU)

I'm not sure, but I think "bar".sizeof is supposed to evaluate to 3 at compile time, rather than 16 regardless of the string's length.
_______________________________________________
dmd-internals mailing list
[email protected]
http://lists.puremagic.com/mailman/listinfo/dmd-internals

Reply via email to