[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[DotGNU]another foreach on BitArray.cs
From: |
Gopal V |
Subject: |
[DotGNU]another foreach on BitArray.cs |
Date: |
Sat, 5 Oct 2002 08:35:16 +0530 |
User-agent: |
Mutt/1.2.5i |
When I foreach'd on BitArray b=new BitArray(new int[]{1023});
I expected a number of 0's and 1's (or atleast True and Falses).
But all I got was "True". So I checked and found this line.
public BitArray(int[] values)
{
if(values == null)
{
throw new
ArgumentNullException("values");
}
- numBits = values.Length;
+ numBits = values.Length * 32 ;
bitArray = (int[])(values.Clone());
This seems to be right ? ... I'm not totally sure about how BitArray works
due to lack of docs .. But this seems to a reasonable assumption ?
The stack is smashed in the earlier foreach bug I posted, so obviously
shown by the -1 values in the stack. But GDB failed to deliver and I
moved back to the good old fprintf and verbose debuggers which print
out the stuff ...
See attached cvmdump for the CVM dump of foreach2.cs . So what happens
here seems to be an erroneous CVMLabel .. and an infinite loop which
pread (pop pointer from stack ?) and pushes the stack into -ve .. So
the segfault ...
Having said all that , I must confess that I'm totally lost at hacking
cvmc.c .. Dealing with CVM is not my speciality , so I'll just have to
leave it there for now .
Gopal
--
The difference between insanity and genius is measured by success
cvmdump
Description: Text document
foreach2.cs
Description: Text document