|
From: Julian S. <js...@ac...> - 2004-03-15 20:55:54
|
> Can somebody (Jeremy?) review it and commit it if it is OK? Just discovered "Kompare". Nice tool! At least in the details, it looks OK. I am a somewhat concerned about the type system abuse that's already there, though (nothing to do with your patch). static void emit_movb_reg_regmem ( Bool bounds, Int reg1, Int reg2 ) First arg is Bool, conceptually 1-bit and in fact unsigned char (see include/vg_skin.h). But then there are calls emit_movb_reg_regmem ( size & DO_BOUNDSCHECK, reg1, reg2 ); This just can't be right, and I'm not even sure what the caller intends here. Not to mention DO_BOUNDSCHECK is 1 << 8 so is zero when interpreted as Bool. If the bounds check always happens for instructions emitted by this call, it's because size just happens to always be 1, 2 or 4 but never zero -- and completely nothing to do with DO_BOUNDSCHECK. I guess the C "type system" (so-called) gets to wear the pointy hat and stand in the corner :-) Anybody know of a way to define a Bool type in C in such a way the compiler can't silently confuse it with any flavour of int? J |