There is an error in the algorithme of TISArrayAsVector::Add(T* t). The comparaison i made on adresses not on pointed elements. See below the extract of code.
bool Add(T* t) {
/* incorrect algorithm
int i = size() - 1;
push_back(t);
while (0 <= i && t < at(i)) {
at(i+1) = at(i);
--i;
}
if (i < (size() - 2)) {
at(i+1) = t;
}*/
// fix by Ruben P
iterator i=begin();
while(i!=end() && t>(*i))
i++;
if (i==end())
push_back(t);
else
insert(i, t);
return true;
}
The correction is :
bool Add(T* t) {
// Fix by Parsys Telemedecine.
if (t != 0)
{
iterator i=begin();
while(i!=end() && (*t)>(*(*i)))
i++;
if (i==end())
push_back(t);
else
insert(i, t);
return true;
}
return false;
}
The proposed fix was applied in [r1872].
Related
Commit: [r1872]
Last edit: Vidar Hasfjord 2013-08-15
Hi
Is there any reason not to include this fix in 6.32.6?
Jogy
Hi Jogy,
As far as I see, it breaks binary compatibility. We are not guaranteed that a call to the Add function actually calls the OWLNext DLL. The function may have been inlined, or otherwise instantiated or optimised, in the client application.