Page 1 of 1

Bug in arrayM_boolean

Posted: 14 Apr 2013 17:16
by Vitaly Markov
There is a bug in implementation of class arrayM_boolean.
It is impossible to clear bit in array by the predicates set(Index,false) and clear(Index).
I propose new edition of predicate set(Idx, Value) in the file

Code: Select all

clauses set(Idx, Value) :-     Index = Idx div byteSize,     % ByteIndex in array     Byte = binary::getIndexed_unsigned8(bin, Index),   % Byte from array     Mask = bit::bitLeft(1, Idx mod byteSize),    (Value = true,!,     NByte = bit::bitOr(Mask, Byte);    % set of bit     Mask1 = bit::bitNot(Mask),     NByte = bit::bitAnd(Mask1, Byte)),   % clear of bit     binary::setIndexed_unsigned8(bin, Index, NByte).

Posted: 14 Apr 2013 18:44
by Thomas Linder Puls
Thank you, you are absolutely right. We will of course fix it.

Posted: 4 Jun 2013 7:53
by Thomas Linder Puls
This is fixed in Build 7402. IDE: Web -> Check for updates...