MPS issue job001556

TitleMPS defect in BS_IS_SINGLE could make some checks ineffective
Statusclosed
Priorityoptional
Assigned userRichard Kistruck
OrganizationRavenbrook
DescriptionMPS defect in BS_IS_SINGLE could make some checks ineffective

RHSK 2006-12-18
BS_IS_SINGLE in misc.h is wrong! See http://info.ravenbrook.com/mail/2006/09/26/19-26-34/0.txt. The MPS only uses this macro in a small number of AVERs and CHECKs. See http://info.ravenbrook.com/mail/2006/09/27/11-35-58/0.txt. The defect could make these checks ineffective.
AnalysisRHSK 2006-12-18
BS_IS_SINGLE is wrong for 0.
Wrong:
#define BS_IS_SINGLE(s) (((s) & ((s)-1)) == 0)
Right:
#define BS_IS_SINGLE(s) ( ((s) != 0) && (((s) & ((s)-1)) == 0) )

Introduced 1997/02/25 18:28:21, change 16806.
How foundunknown
Evidence//info.ravenbrook.com/project/mps/master/code/misc.h#13
http://info.ravenbrook.com/mail/2006/09/26/19-26-34/0.txt
Observed in1.107.0
Created byRichard Kistruck
Created on2006-12-18 15:38:10
Last modified byRichard Kistruck
Last modified on2006-12-18 16:10:45
History2006-12-18 RHSK Created.

Fixes

Change Effect Date User Description
161296 closed 2006-12-18 16:10:17 Richard Kistruck MPS correct BS_IS_SINGLE (only used in AVERs and CHECKs)