Skip to content

Commit

Permalink
Set yytoken to non-negative value for [coverity CID 29259]
Browse files Browse the repository at this point in the history
  • Loading branch information
dajobe committed Apr 19, 2014
1 parent e2efe02 commit 624518f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions scripts/fix-bison
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,15 @@ while(<>) {
next;
}

if(m%yysyntax_error_status = YYSYNTAX_ERROR%) {
# Set yytoken to non-negative value for coverity CID 29259
my $line=$_;
print qq{if(yytoken < 0) yytoken = YYUNDEFTOK;\n};
$line_offset++; # extra line
print $line;
next;
}

# Suppress warnings about empty declarations
s/(^static int .*_init_globals.*);$/$1/;

Expand Down

0 comments on commit 624518f

Please sign in to comment.