[Bug c++/71182] [6/7 Regression] parser.c cp_lexer_previous_token sanitizer detects member call on null pointer

trippels at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Nov 30 09:12:00 GMT 2016


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71182

Markus Trippelsdorf <trippels at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2016-11-30
                 CC|                            |dmalcolm at gcc dot gnu.org,
                   |                            |trippels at gcc dot gnu.org
   Target Milestone|---                         |6.4
            Summary|parser.c                    |[6/7 Regression] parser.c
                   |cp_lexer_previous_token     |cp_lexer_previous_token
                   |sanitizer detects member    |sanitizer detects member
                   |call on null pointer        |call on null pointer
     Ever confirmed|0                           |1

--- Comment #1 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
Confirmed. Started with r231293:

commit 3d27a0fa5bfc6af64855917aa6f644d2386f8300
Author: dmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4>
Date:   Fri Dec 4 18:09:54 2015 +0000

    C++ FE: expression ranges

markus@x4 tmp % UBSAN_OPTIONS=print_stacktrace=1
/var/tmp/gcc_ubsan/usr/local/bin/g++ -c parse.ii
../../gcc/gcc/cp/parser.c:768:7: runtime error: member call on null pointer of
type 'struct vec'
    #0 0xb5dd4f in cp_lexer_previous_token ../../gcc/gcc/cp/parser.c:768
    #1 0xb5dd4f in cp_parser_postfix_dot_deref_expression
../../gcc/gcc/cp/parser.c:7451
    #2 0xb6b22d in cp_parser_postfix_expression ../../gcc/gcc/cp/parser.c:7047
    #3 0xb70da1 in cp_parser_unary_expression ../../gcc/gcc/cp/parser.c:8099
    #4 0xb74cf8 in cp_parser_cast_expression ../../gcc/gcc/cp/parser.c:8776
    #5 0xb76faa in cp_parser_binary_expression ../../gcc/gcc/cp/parser.c:8877
    #6 0xb79d40 in cp_parser_assignment_expression
../../gcc/gcc/cp/parser.c:9164
    #7 0xb88fc0 in cp_parser_expression ../../gcc/gcc/cp/parser.c:9333
    #8 0xb79f99 in cp_parser_question_colon_clause
../../gcc/gcc/cp/parser.c:9107
    #9 0xb79f99 in cp_parser_assignment_expression
../../gcc/gcc/cp/parser.c:9170
    #10 0xb88fc0 in cp_parser_expression ../../gcc/gcc/cp/parser.c:9333
    #11 0xb9c9b0 in cp_parser_expression_statement
../../gcc/gcc/cp/parser.c:10877
    #12 0xb44d29 in cp_parser_statement ../../gcc/gcc/cp/parser.c:10693
    #13 0xb497a0 in cp_parser_statement_seq_opt ../../gcc/gcc/cp/parser.c:11019
    #14 0xb49aa4 in cp_parser_compound_statement
../../gcc/gcc/cp/parser.c:10973
    #15 0xb96988 in cp_parser_function_body ../../gcc/gcc/cp/parser.c:21357
    #16 0xb96988 in cp_parser_ctor_initializer_opt_and_function_body
../../gcc/gcc/cp/parser.c:21393
    #17 0xbb9fa2 in cp_parser_function_definition_after_declarator
../../gcc/gcc/cp/parser.c:26151
    #18 0xbbb144 in cp_parser_late_parsing_for_member
../../gcc/gcc/cp/parser.c:27033
    #19 0xb2e24f in cp_parser_class_specifier_1 ../../gcc/gcc/cp/parser.c:22244
    #20 0xb34f42 in cp_parser_class_specifier ../../gcc/gcc/cp/parser.c:22270
    #21 0xb34f42 in cp_parser_type_specifier ../../gcc/gcc/cp/parser.c:16386
    #22 0xb3780c in cp_parser_decl_specifier_seq
../../gcc/gcc/cp/parser.c:13303
    #23 0xb38d5a in cp_parser_single_declaration
../../gcc/gcc/cp/parser.c:26521
    #24 0xbb78ee in cp_parser_template_declaration_after_parameters
../../gcc/gcc/cp/parser.c:26212
    #25 0xbb6b9a in cp_parser_explicit_template_declaration
../../gcc/gcc/cp/parser.c:26448
    #26 0xbb6b9a in cp_parser_template_declaration_after_export
../../gcc/gcc/cp/parser.c:26466
    #27 0xb3a349 in cp_parser_declaration ../../gcc/gcc/cp/parser.c:12445
    #28 0xbec445 in cp_parser_declaration_seq_opt
../../gcc/gcc/cp/parser.c:12364
    #29 0xbecfee in cp_parser_translation_unit ../../gcc/gcc/cp/parser.c:4368
    #30 0xbecfee in c_parse_file() ../../gcc/gcc/cp/parser.c:38262
    #31 0x1101f4b in c_common_parse_file() ../../gcc/gcc/c-family/c-opts.c:1098
    #32 0x24f370a in compile_file ../../gcc/gcc/toplev.c:463
    #33 0x64bea4 in do_compile ../../gcc/gcc/toplev.c:1983
    #34 0x64bea4 in toplev::main(int, char**) ../../gcc/gcc/toplev.c:2117
    #35 0x64e4d6 in main ../../gcc/gcc/main.c:39
    #36 0x7f2977921310 in __libc_start_main ../csu/libc-start.c:286
    #37 0x64e8e9 in _start
(/var/tmp/gcc_ubsan/usr/local/libexec/gcc/x86_64-pc-linux-gnu/7.0.0/cc1plus+0x64e8e9)


More information about the Gcc-bugs mailing list