Weird Intel C++ compiler error
===

I'm working on this VST convolution plugin (Windows 7 64bit, VS2010) and I decided to try the Intel c++ compiler. I was in the process of optimizing the algorithm so I had a backup project in case of any screw ups and one I was doing experiments on. Both projects would compile and run with no problems. After installing the Intel compiler though the project I was experimenting on would cause a heap corruption error, so I start debugging to track down the problem but I can't find the line of code that causes it since the heap corruption error is not triggered during execution but after the termination of the DLL (there are also no access violations showed by the debugger).

At this point I start cutting out parts of the code to see if I can isolate the problem and I discover (obviously) that it was the class I was eperimenting on. Now here comes the weird part: I can change the code inside the methods but as soon as I add a variable to the backup class (the one that works fine), even an int, I get the heap corruption error, just a decleared and never referenced variable is enough.

This class (CRTConvolver) makes use of several buffers which are also classes, here's what the code of a buffer class looks like:


    class Buff {
    public:	
        	Buff();
	        Buff(unsigned len);
	        ~Buff();

	        float* buff;
	        unsigned long length;

    private:

	        void Init(unsigned long len);
	        void flush();

	        friend class CRTConvolver; 
    }

this is the code in the constructor:

    Buff::Buff()
    {
        	length=NULL;
        	buff=NULL;
    }

for the purpose of debugging I left the destructor empty, so basically this class if created and destructed does absolutely nothing, it just contains the length and buff variables. If I also bypass those two variable initializations the heap error goes away.

This is the part that really doesn't make sense to me cause all the instances of this Buff class are declared like this:

    Buff Output, Input....ecc ;

As a side note, I create my CRTConvolver class like this:

    ConvEng = new CRTConvolver[NCHANNELS];

If I declare it like this instead:

    CRTConvolver ConvEng[NCHANNELS];

I get a stack corruption error around variable ConvEng.
If I switch back to Microsoft compiler the situation stays the same even when compiling and running the exact same version that could run without errors before....

I'm really running out of ideas here, I hope someone will be able to help.

thanks