We are under pressure to implement a software project before a deadline and have the software run as fast as possible by then. A minor optimization would be the use of a different data structure. My supervisor implemented this data structure several years ago. He now gave me his implementation and told me to use it, he expected it to be a very minor change.
However, I noticed a possible memory corruption in his implementation, requiring an (almost) complete rewrite to be usable. This would be a bad use of my time given the deadline pressure. Should I tell him, rewrite the code myself, or simply not do it and only mention it when asked?
Update: I wrote a quick test case. It didn't show the memory corruption I expected, but showed that the performance improvement was not as big as hoped and that side effects occur which impact the solution quality. We talked about the results and agreed not to use the new data structure.