[llvm-bugs] [Bug 30817] New: Negative line number on 'expected relocation error'

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Oct 27 23:28:43 PDT 2016


https://llvm.org/bugs/show_bug.cgi?id=30817

            Bug ID: 30817
           Summary: Negative line number on 'expected relocation error'
           Product: new-bugs
           Version: 3.9
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: pmatos at linki.tools
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

test.S:

.4byte ~foo
#include "foo.h"

foo.h: is an empty file. 

Then run:
$ clang -cc1as -filetype obj -main-file-name test.S -dwarf-version=4
-fdebug-compilation-dir /home/pmatos/Clients/embecosm/BUGS/b447/asm-lineno
-mrelocation-model static -dwarf-version=4 -o test.o test.s
test.S:-2:8: error: expected relocatable expression
.4byte ~foo
       ^

I very much doubt there's a line -2 in the file.

However, I know what the problem is. At this point the parsing of the asm has
finished. However the error handler calls DiagHandler which assumes the parsing
is ongoing and uses CppHashLoc variables. These variable are however of no more
use because they all now point to the last Hash line seen in the file, not the
one before the error.

I will submit a patch to fix this soon.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20161028/29aec3e9/attachment.html>


More information about the llvm-bugs mailing list