.NET/C#/MSIL Bug report

  • Thread starter Thread starter Filip Strugar
  • Start date Start date
F

Filip Strugar

...or where should I post it if this is not the right place?



Goes like this: I've got a following method in a class DataSource:



public IHeightmapSampler GetSampler(ushort maxSmpX, ushort maxSmpY)

{

if (maxSmpX == data.GetLength(0) && maxSmpY == data.GetLength(1))

return new DirectSampler(data);



throw new Exception("Map size is different than heightmap data size

but no other than DirectSampler avaliable.");

}



When I do DataSource.GetSampler() some other random method get's called
(both std debug/release build, with many variations).

I was surprised when, while debugging, I stepped into
DataSource.GetSampler() call but finished in some other property get_xx
method :)



Afther many variations I returned the 'return null; ' line (that I removed
to avoid unreachable code warning) and surprise - it works properly.



public IHeightmapSampler GetSampler(ushort maxSmpX, ushort maxSmpY)

{

if (maxSmpX == data.GetLength(0) && maxSmpY == data.GetLength(1))

return new DirectSampler(data);



throw new Exception("Map size is different than heightmap data size

but no other than DirectSampler avaliable.");

return null;

}



I'm using VS.NET 2003.

By the way, that's the second bug of that sort, I had a method that refused
to execute (access violation) unless some random code was added to it.
(VS.NET) Can't find it now :(
 
What kind of program is this by chance? Is it a DLL or maybe a service or
something unusual, or is it just a plain executeable?

There have been times I've debugged a DLL and without realizing it, I was
debugging a copy located somewhere else and not the one I was actually
building, so while trying to trace, there were times when the debugger would
seem to be at wrong lines of code, or it would jump over pieces of code when
in fact, it was because the debug info and source didn't match the binary
DLL that was being debugged.

Anyway, just a thought.

Pete
 
Filip Strugar said:
..or where should I post it if this is not the right place?



Goes like this: I've got a following method in a class DataSource:

My working assumption is that you are simply confused.

You would need to post a working sample of your problem for any other
conclusion to be reasonable.

David
 
Back
Top