Changeset 10971


Ignore:
Timestamp:
Oct 4, 2008, 5:34:26 AM (11 years ago)
Author:
gb
Message:

zero_bits: parenthesize, so that the multiplication happens after the
shift. (Doing it the other way may zero too many bits, causing heap
corruption as used in init_win32_ldt(), though apparently not when
running under GDB. This in turn has other side-effects: wasting most
of a week, adding a mechanism for target-specific static addresses that
apparently isn't necessary, etc.)

Moral: always saturate C code with parens.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/lisp-kernel/bits.c

    r1702 r10971  
    5757zero_bits(bitvector bits, natural nbits)
    5858{
    59   memset(bits, 0, ((sizeof(natural)*((nbits+(nbits_in_word-1)))>>bitmap_shift)));
     59  memset(bits, 0, ((sizeof(natural)*(((nbits+(nbits_in_word-1)))>>bitmap_shift))));
    6060}
    6161
Note: See TracChangeset for help on using the changeset viewer.