I'm working on some really old Windows Software (First realease in the early 90s). The current Version is developed with Visual Studio 2012.
My task is to increase the accuracy of a numerical calculation which seems to have really bad condition.
As I don't understand the underlying math, the code is ugly and huge and the deadline close I tried to replace all double variables with the boost cpp_bin_float_100 for increased accuracy.
The problem:
The programm crashes reprodcible with a "Buffer overrun" message on the same line:
c= 2*J*L+K*K-G;
where each variable is a cpp_bin_float_100.
In double precission the code runs fine.
I have no Idea how to approach this problem.
What we know:
* The program crashes deterministically.
* The expression where it does it is c= 2*J*L+K*K-G (whatever that means).
* The error message is about a buffer overflow.
What can we find out?
* Is everything properly initialized?
* Do J, L, K, and G all refer to valid objects? For example, if you do
1 2 3 4 5 6
int &foo(){
int ret = 0;
return ret;
}
int &bar = foo();