|
This happens in a large function, which has a relatively complicated algorithm.
Simply speaking, its structure is as such:
___________________________________________________________
some basic calculation
------------------------------
y = expression;
-------------------------------
____________________________________________________________
some operations
--------------------------------
--------------------------------
if {
block 1;
}
else{
if { block 2; }
else { block 3; }
}
The structure of blocks 2 and 3 will change the way in which y is calculated. The result is wrong. I check it through gdb. The five results above are obtained at the same environment except for the changes in the two blocks
In many executions, y is always equal to 0. Otherwise, it will be far larger than a right value.
But when either or each of the two blocks is removed, y will obtain a normal value.
I can not understand
|