Skip to content

After r303589, Assertion failed: (0 <= N && N < static_cast<int>(m_byteToColumn.size())), function byteToContainingColumn, file tools/clang/lib/Frontend/TextDiagnostic.cpp, line 281. #33249

@DimitryAndric

Description

@DimitryAndric
Bugzilla Link 33902
Resolution FIXED
Resolved on Aug 28, 2017 09:02
Version trunk
OS All
Blocks #33196
CC @emaste,@zmodem,@zygoloid,@sesse

Extended Description

I recently imported llvm/clang trunk r308421 into FreeBSD 12-CURRENT, and afterwards, I got a report [1] that building the graphics/libchamplain port lead to an assertion failure:

Assertion failed: (0 <= N && N < static_cast(m_byteToColumn.size())), function byteToContainingColumn, file /poudriere/jails/head-amd64/usr/src/contrib/llvm/tools/clang/lib/Frontend/TextDiagnostic.cpp, line 281.

Bisection shows this assertion failure has been introduced by r303589. Minimized test case:

#define a(b) #b
#define c(d) _Pragma(a(d))
#define e(f) c(GCC warning #f)
e() e()

Output of clang r303588:

testcase.c:4:1: warning:  [-W#pragma-messages]
e() e()
^
testcase.c:3:14: note: expanded from macro 'e'
#define e(f) c(GCC warning #f)
             ^
testcase.c:2:14: note: expanded from macro 'c'
#define c(d) _Pragma(a(d))
             ^
<scratch space>:4:6: note: expanded from here
 GCC warning ""
     ^
testcase.c:4:5: warning:  [-W#pragma-messages]
e() e()
    ^
testcase.c:3:14: note: expanded from macro 'e'
#define e(f) c(GCC warning #f)
             ^
testcase.c:2:14: note: expanded from macro 'c'
#define c(d) _Pragma(a(d))
             ^
<scratch space>:5:6: note: expanded from here
 GCC warning ""
     ^
2 warnings generated.

Output of clang r303589:

testcase.c:4:1: warning:  [-W#pragma-messages]
e() e()
^
testcase.c:3:14: note: expanded from macro 'e'
#define e(f) c(GCC warning #f)
             ^
testcase.c:2:14: note: expanded from macro 'c'
#define c(d) _Pragma(a(d))
             ^
<scratch space>:4:6: note: expanded from here
 GCC warning ""
     ^
testcase.c:4:5: warning:  [-W#pragma-messages]
e() e()
    ^
testcase.c:3:14: note: expanded from macro 'e'
#define e(f) c(GCC warning #f)
             ^
testcase.c:2:14: note: expanded from macro 'c'
#define c(d) _Pragma(a(d))
             ^
<scratch space>:5:6: note: expanded from here
Assertion failed: (0 <= N && N < static_cast<int>(m_byteToColumn.size())), function byteToContainingColumn, file /home/dim/src/llvm-trunk/tools/clang/lib/Frontend/TextDiagnostic.cpp, line 281.

[1] http://gohan2.ysv.freebsd.org/data/head-amd64-default-baseline/p446433_s321376/logs/errors/libchamplain-0.12.15.log

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillaclangClang issues not falling into any other category

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions