|
From: Daniel J S. <dan...@ie...> - 2009-02-19 07:07:20
|
Ethan A Merritt wrote:
> On Tuesday 17 February 2009, James R. Van Zandt wrote:
>
>>I ran across a reliable segfault with the splot command, with the
>>current CVS code:
>
>
> There is now a fix for this problem in CVS.
>
> Ethan
I see now. The fix works.
I'd say though that the hunk of code as it existed (exists) wasn't as clean as it could have been. For example, the addition of this line:
@@ -1743,6 +1743,7 @@
this_plot->plot_type = DATA3D;
this_plot->plot_style = this_style;
+ this_plot->iteration = iteration;
/* Struct copy */
this_plot->lp_properties = *these_props;
likely isn't needed because next time through the loop "this_plot->iteration = iteration" is done higher up in the while do/while loop. (Global "iteration" is modified by the parse.c code, none of which is called here so global "iteration" should not change in between the two assignments.)
In fact, the "while (df_return != DF_EOF)" won't have a chance to fail because higher in the loop is a break statement
if (df_return == DF_EOF)
break;
Going a little higher up in the loop is
do {
this_plot = *tp_3d_ptr;
but this is extraneous because notice a few lines before this is
assert(this_plot == *tp_3d_ptr);
and at the bottom of the loop is
if ((this_plot = *tp_3d_ptr) != NULL) {
if (this_plot->title) {
free(this_plot->title);
this_plot->title = NULL;
}
} else {
/* Allocate enough isosamples and samples */
this_plot = *tp_3d_ptr = sp_alloc(0, 0, 0, 0);
}
so it is certain that "this_plot == *tp_3d_ptr".
Dan
|