From c986597f1c330c056f9e2baeb60fcf0835f71f45 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Wed, 22 Jul 2009 22:58:09 +0000 Subject: [PATCH] Reject breaktables with slope of zero. --- src/dbStatic/dbLexRoutines.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/dbStatic/dbLexRoutines.c b/src/dbStatic/dbLexRoutines.c index b5f969d7c..57461d3a0 100644 --- a/src/dbStatic/dbLexRoutines.c +++ b/src/dbStatic/dbLexRoutines.c @@ -872,10 +872,14 @@ static void dbBreakBody(void) double slope = (paBrkInt[i+1].eng - paBrkInt[i].eng)/ (paBrkInt[i+1].raw - paBrkInt[i].raw); + if (!dbBptNotMonotonic && slope == 0) { + yyerrorAbort("breaktable slope is zero"); + return; + } if (i == 0) { down = (slope < 0); } else if (!dbBptNotMonotonic && down != (slope < 0)) { - yyerrorAbort("breaktable: curve slope changes sign"); + yyerrorAbort("breaktable slope changes sign"); return; } paBrkInt[i].slope = slope;