This weekend I had to change a little istack_struct for my patch.
Looking at function create_istack() from objects.c I have noticed
that there is pov_malloc dependant of
global setting max_intersections.
In povray 3.1 we hadn't calling to create_istack
during parsing becouse there wasn't such thing like
trace or eval_pattern{proximity pattern}.
But in mega pov and in pov 3.5 there is trace ().
Therefore such syntax can cause undefined errors:
#declare Object=csg{}
global_settings{max _intersections value}
/* reserve first level of stack of intersections */
trace(Object,syntax_for_trace)
/* first calling of open_istack cause allocate table of intersections */
global_settings{max _intersections more_than_previous}
/* extend global (there is no realloc or something) */
trace(Object,syntax_for_trace)
/* uses previous allocated table but with greater limit */
this cause that pov try write more entries to istack than is allocated
what I suggest - disable possibility of changing max intersection
after first allocation of istack
parse.c - Parse_Frame() and Parse_Global_Settings()
instead of:
CASE (MAX_INTERSECTIONS)
Max_Intersections = (int)Parse_Float ();
END_CASE
should be:
CASE (MAX_INTERSECTIONS)
if ( free_istack != NULL )
{
Error("max_intersection can't be modified after first intersection
calling.");
}
else
{
Max_Intersections = (int)Parse_Float ();
}
END_CASE
and btw: when I set max_intersection to 1 - megapov 0.6a.win crashed
ABX
Post a reply to this message
|