Skip to content

Commit

Permalink
Merge branch 'fix-github-lpreader-issue' into 'v80-bugfix'
Browse files Browse the repository at this point in the history
Fix github lpreader issue

See merge request integer/scip!2797
  • Loading branch information
leoneifler committed Jan 14, 2022
2 parents 345e79c + 2c971a5 commit c636343
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/scip/reader_lp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1026,6 +1026,12 @@ SCIP_RETCODE readCoefficients(
/* check if we read a sign */
if( isSign(lpinput, &coefsign) )
{
if( havevalue )
{
syntaxError(scip, lpinput, "sign after value without variable.");
return SCIP_OKAY;
}

SCIPdebugMsg(scip, "(line %d) read coefficient sign: %+d\n", lpinput->linenumber, coefsign);
havesign = TRUE;
continue;
Expand Down Expand Up @@ -1053,6 +1059,18 @@ SCIP_RETCODE readCoefficients(
return SCIP_OKAY;
}

if( havevalue )
{
syntaxError(scip, lpinput, "no constant values allowed for constraints in lp file format");
return SCIP_OKAY;
}

if( havesign )
{
syntaxError(scip, lpinput, "constaint has sign without a variable");
return SCIP_OKAY;
}

/* put the sense back onto the token stack */
pushToken(lpinput);
break;
Expand Down

0 comments on commit c636343

Please sign in to comment.