fixed undefined behaviour in array_sum

The exact situation is when passing same pointer twice to
fast_add_function(). This prorably has to be fixed in mainstream too.