poke-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug default/25400] New: The lexer doesn't check for overflow/underflow


From: jose.marchesi at oracle dot com
Subject: [Bug default/25400] New: The lexer doesn't check for overflow/underflow in integer tokens
Date: Thu, 16 Jan 2020 11:13:25 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=25400

            Bug ID: 25400
           Summary: The lexer doesn't check for overflow/underflow in
                    integer tokens
           Product: poke
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: default
          Assignee: unassigned at sourceware dot org
          Reporter: jose.marchesi at oracle dot com
                CC: poke-devel at nongnu dot org
  Target Milestone: ---

The PKL lexer in pkl-lex.l does not check for underflow/overflow while
generating integer tokens:

  /* Note that strtol can't fail in this context.  */
  value = strtoll (yytext + offset, &end, base);

This means that large values (bigger than 64-bits) silently get
truncated:

  (poke) 99999999999999999999999999999999999
  0x7fffffffffffffffL

The solution for this is to check for underflow/overflow in the lexer
rules for both integers and offset units, and emit a warning about the
value being truncated.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]