bug-binutils
[Top][All Lists]
Advanced

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

[Bug gas/10241] New: incorrect parsing of floating point literals


From: mshinwell at janestcapital dot com
Subject: [Bug gas/10241] New: incorrect parsing of floating point literals
Date: 4 Jun 2009 17:26:52 -0000

gas fails to parse floating point literals correctly when the first character 
of the literal is '0' and the 
second character is a letter of the alphabet.  For example, 0e-4 parses as -4, 
and even 0e0e-4 is 
accepted (and parses to zero).  The issue is clearly most serious in the 0e-4 
case.

I think this is a host/build/target-triplet independent problem.  The offending 
code is in 
gas/read.c:s_float_space:

  /* Skip any 0{letter} that may be present.  Don't even check if the
   * letter is legal.  */
  if (input_line_pointer[0] == '0'
      && ISALPHA (input_line_pointer[1]))
    input_line_pointer += 2;

It seems unclear what the purpose of this code is.

Test case, test.s (zeros interspersed to make the output easier):

        .data
        .double 0e0e-4
        .double 0
        .double 0e-4
        .double 0
        .double -4.0
        .double 0

$ ./install/bin/x86_64-pc-linux-gnu-as -o test.o test.s && 
./install/bin/x86_64-pc-linux-gnu-
objdump -Dr test.o

-- 
           Summary: incorrect parsing of floating point literals
           Product: binutils
           Version: 2.19
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gas
        AssignedTo: unassigned at sources dot redhat dot com
        ReportedBy: mshinwell at janestcapital dot com
                CC: bug-binutils at gnu dot org


http://sourceware.org/bugzilla/show_bug.cgi?id=10241

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.




reply via email to

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