have a weird bug, allow me a sanity check, please. consider:
if this is called concurrently by multiple threads, there is 1 instance of x per thread, correct? each thread has it's own stack, right?Code:void foo(const std::vector<int>&v,unsigned int start,unsigned int stop,unsigned int& sum) { unsigned int x; for(x=start;x<stop;++x) { sum+=v[x]; } }
i'm getting buffer overrun using code that was copied and pasted from a function that works fine.