Achim Spangler | 2 Nov 2006 22:35
Picon

Bugfix for strange SEGFAULT in UMLClassifier::checkOperationSignature()

Hi,
I discovered a strange problem with creation of overloaded member functions 
(i.e. same name but different attributes).

While a small project didn't cause a problem, my big project caused always a 
SEGFAULT, when I tried to insert a function to a class, which has already a 
function with same name but different signature.

I detected, that somehow the stack got corrupted in 
UMLClassifier::checkOperationSignature(), so that the SEGFAULT has been 
caused at very surprising points - for example the stack view in kdbg showed 
me the line 

int pCount = testParams->count();

as the last executed line before the SEGFAULT. The pointer testParams is NOT 
NULL at this point, and the list is also not broken, as the function 
testParams->isEmpty() does NOT cause any segfault.

I changed the parameter comparing loop to NOT use "count()" - just by 
iterating with first() and next().

THIS version does NOT cause any SEGFAULT - even with my big project - I really 
do not know why.

Please merge the attached patch, as it should be even a little more 
efficient - it is at least not having a lower quality.

Bye,
Achim
(Continue reading)


Gmane