* Completion_heads_engraver now gives a programming_error instead of trying to make negative-duration notes.
* intlog2 with a nonpositive argument now gives an error instead of an infinite loop.
}
Moment result = *l - *e;
+ if (result < 0)
+ {
+ programming_error ("invalid measure position: "
+ + e->to_string () + " of " + l->to_string ());
+ return 0;
+ }
Moment const *unit = unsmob_moment (get_property ("completionUnit"));
if (unit)
int
intlog2 (int d)
{
- assert (d);
+ if (d <= 0)
+ error ("intlog2 with negative argument: " + to_string (d));
int i = 0;
while ((d != 1))
{