src/compiler/glsl/glcpp/glcpp-parse.y:1297: _token_print: Assertion `!"Error: Don't know how to print token."' failed.
This shader triggers a crash in the GLSL compiler.
void main()
{
int i = int("1");
}
src/compiler/glsl/glcpp/glcpp-parse.y:1297: _token_print: Assertion `!"Error: Don't know how to print token."' failed.
(gdb) bt
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1 0x00007fe48d3a6899 in __GI_abort () at abort.c:79
#2 0x00007fe48d3a6769 in __assert_fail_base (fmt=0x7fe48d53afb8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n",
assertion=0x558eabdc4648 "!\"Error: Don't know how to print token.\"", file=0x558eabdc4620 "src/compiler/glsl/glcpp/glcpp-parse.y",
line=1297, function=<optimized out>) at assert.c:92
#3 0x00007fe48d3b8006 in __GI___assert_fail (assertion=0x558eabdc4648 "!\"Error: Don't know how to print token.\"",
file=0x558eabdc4620 "src/compiler/glsl/glcpp/glcpp-parse.y", line=1297, function=0x558eabdc4b28 <__PRETTY_FUNCTION__.35010> "_token_print")
at assert.c:101
#4 0x0000558eabd79087 in _token_print (out=0x558ead7da5a0, token=0x558ead7e3bf8) at src/compiler/glsl/glcpp/glcpp-parse.y:1297
#5 0x0000558eabd795a4 in _token_list_print (parser=0x558ead7dd330, list=0x558ead7e3910) at src/compiler/glsl/glcpp/glcpp-parse.y:1436
#6 0x0000558eabd7a996 in _glcpp_parser_print_expanded_token_list (parser=0x558ead7dd330, list=0x558ead7e3910)
at src/compiler/glsl/glcpp/glcpp-parse.y:2171
#7 0x0000558eabd75c77 in glcpp_parser_parse (parser=0x558ead7dd330) at src/compiler/glsl/glcpp/glcpp-parse.y:229
#8 0x0000558eabd3cbc2 in glcpp_preprocess (ralloc_ctx=0x558ead7db7f0, shader=0x7fff868dd598, info_log=0x558ead7dbac0,
extensions=0x558eabc95ba4 <add_builtin_defines(_mesa_glsl_parse_state*, void (*)(glcpp_parser*, char const*, int), glcpp_parser*, unsigned int, bool)>, state=0x558ead7db7f0, gl_ctx=0x558eabdfbda0 <main::local_ctx>) at src/compiler/glsl/glcpp/pp.c:238
#9 0x0000558eabc961fb in _mesa_glsl_compile_shader (ctx=0x558eabdfbda0 <main::local_ctx>, shader=0x558ead7d93b0, dump_ast=false,
dump_hir=false, force_recompile=true) at src/compiler/glsl/glsl_parser_extras.cpp:2183
#10 0x0000558eabc317b6 in compile_shader (ctx=0x558eabdfbda0 <main::local_ctx>, shader=0x558ead7d93b0) at src/compiler/glsl/standalone.cpp:398
#11 0x0000558eabc31dd5 in standalone_compile_shader (_options=0x558eabdfbd80 <options>, num_files=1, files=0x7fff868dd8b0,
ctx=0x558eabdfbda0 <main::local_ctx>) at src/compiler/glsl/standalone.cpp:501
#12 0x0000558eabc332d4 in main (argc=4, argv=0x7fff868dd898) at src/compiler/glsl/main.cpp:97
(gdb) frame 4
#4 0x0000558eabd79087 in _token_print (out=0x558ead7da5a0, token=0x558ead7e3bf8) at src/compiler/glsl/glcpp/glcpp-parse.y:1297
1297 assert(!"Error: Don't know how to print token.");
(gdb) print *token
$1 = {type = 287, value = {ival = 94071284448232, expression_value = {value = 94071284448232, undefined_macro = 0x0},
str = 0x558ead7e3be8 "\"1\"", string_list = 0x558ead7e3be8, token = 0x558ead7e3be8, token_list = 0x558ead7e3be8}, location = {
first_line = 3, first_column = 17, last_line = 3, last_column = 20, source = 0}}
67b32190f3c953c5b7091d76ddeff95c0cbfb439 is the first bad commit
commit 67b32190f3c953c5b7091d76ddeff95c0cbfb439
Author: Timothy Arceri <tarceri@itsqueeze.com>
Date: Wed Aug 14 14:24:31 2019 +1000
glsl: add ARB_shading_language_include support to #line
From the ARB_shading_language_include spec:
"#line must have, after macro substitution, one of the following
forms:
#line <line>
#line <line> <source-string-number>
#line <line> "<path>"
where <line> and <source-string-number> are constant integer
expressions and <path> is a valid string for a path supplied in the
#include directive. After processing this directive (including its
new-line), the implementation will behave as if it is compiling at
line number <line> and source string number <source-string-number>
or <path> path. Subsequent source strings will be numbered
sequentially, until another #line directive overrides that
numbering."
Reviewed-by: Witold Baryluk <witold.baryluk@gmail.com>
src/compiler/glsl/ast.h | 4 +++
src/compiler/glsl/glcpp/glcpp-lex.l | 5 ++++
src/compiler/glsl/glcpp/glcpp-parse.y | 15 ++++++++--
src/compiler/glsl/glsl_lexer.ll | 47 +++++++++++++++++++++++++++++++-
src/compiler/glsl/glsl_parser.yy | 1 +
src/compiler/glsl/glsl_parser_extras.cpp | 14 ++++++----
src/compiler/glsl/glsl_parser_extras.h | 2 ++
7 files changed, 80 insertions(+), 8 deletions(-)
bisect run success
cc: @tarceri