diff options
author | Jeroen Vermeulen <jtv@xs4all.nl> | 2016-03-22 22:51:04 +0300 |
---|---|---|
committer | Jeroen Vermeulen <jtv@xs4all.nl> | 2016-03-22 22:51:04 +0300 |
commit | 26cff2c62d859dd5c40aeab96c28847c5b3a743a (patch) | |
tree | 4bab4b8378fd591fac92f5d40265b228fa7217a3 | |
parent | 6baff1961eb4d6dcea86841fd5e7924eb05300da (diff) |
Fix array overrun.
Looks like MYOptimization was added as an afterthought but never fully
implemented. An array was created to cover all optimization classes
except this one, and then the entry for MYOptimization was initialized
beyond the end.
Since all other code appeared to ignore the entry anyway, I simply
removed the poisonous initialization.
-rw-r--r-- | mgizapp/src/mkcls/ProblemTest.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/mgizapp/src/mkcls/ProblemTest.cpp b/mgizapp/src/mkcls/ProblemTest.cpp index 8951159..a8bb25a 100644 --- a/mgizapp/src/mkcls/ProblemTest.cpp +++ b/mgizapp/src/mkcls/ProblemTest.cpp @@ -223,7 +223,13 @@ void multiSolveProblem(Problem &problem,int versuche,int maxSeconds) end[GDA_OPT].title = " GDA"; end[RRT_OPT].title = " RRT"; end[TA_OPT].title = " TA"; - end[MY_OPT].title = " MY"; + + /* What's this for? It goes beyond the end of the array, because of the + * order of the TA_OPT/HC_OPT/SA_OPT/... enum values. The code ignores + * this extra field, going only up to MAX_OPT_NR. Looks as if MY_OPT was + * added as an afterthought and never fully implemented. + */ + // end[MY_OPT].title = " MY"; for(i=0; i<MAX_OPT_NR; i++) end[i].quantil(0.5); |