DescriptionFix uninitialized variables when Source_file::get_counts returns early due to !contains (pos_str0)
Most code that called get_counts simply is like:
int line, chr, col, offset = 0;
source_file_->get_counts (end_, &line, &chr, &col, &offset);
Now, unfortunately get_counts returns early sometimes (if we don't have a position), so
only line_number would be initialized to 0, all other variables would stay uninitialized.
And most code simply passed them on to other guile functions to handle.
This patch moved the initialization of all arguments to the very beginning of get_counts
and thus never returns uninizialized variables.
This shuts up several valgrind warnings in our regtests.
Patch Set 1 #
MessagesTotal messages: 10
|