Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: bc13a79e197e191d2c6cb0ec76217e27e0932575
      
https://github.com/Perl/perl5/commit/bc13a79e197e191d2c6cb0ec76217e27e0932575
  Author: David Mitchell <[email protected]>
  Date:   2020-12-08 (Tue, 08 Dec 2020)

  Changed paths:
    M perly.c

  Log Message:
  -----------
  perly.y: avoid <0 test on unsigned value

Coverity CID 313707

Moving to a newer version of Bison has changed how the YYTRANSLATE()
macro is defined: in particular it now has a <0 test, which
Coverity is complaining about, since the arg is an unsigned value.

This commit just casts the arg back to a signed value. In more detail:
we formerly had:

    yytoken = YYTRANSLATE(NATIVE_TO_UNI(parser->yychar));

yychar is of type int, but NATIVE_TO_UNI returns a UV. So just cast the
result back to an int:

    yytoken = YYTRANSLATE((int)NATIVE_TO_UNI(parser->yychar));

Reply via email to