compiler: fix parsing issue with non-ASCII first package char
commita978283563476f21867a9657ce2caaeec9cf4f3a
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 28 Sep 2018 13:50:44 +0000 (28 13:50 +0000)
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 28 Sep 2018 13:50:44 +0000 (28 13:50 +0000)
tree2e728c762d8fbbc8f02354036c932abcdf83ea28
parent0e59d2fbb80c7c525fbc1ed73099f447e546c208
compiler: fix parsing issue with non-ASCII first package char

    Fix a bug in the parser code that decides whether a given name should
    be considered exported or not. The function Lex::is_exported_name
    (which assumes that its input is a mangled name) was being called on
    non-mangled (raw utf-8) names in various places. For the bug in
    question this caused an imported package to be registered under the
    wrong name. To fix the issue, rename 'Lex::is_exported_name' to
    'Lex::is_exported_mangled_name', and add a new 'Lex::is_exported_name'
    that works on utf-8 strings.

    Fixes golang/go#27836.

    Reviewed-on: https://go-review.googlesource.com/137736

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@264690 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/go/gofrontend/MERGE
gcc/go/gofrontend/import.cc
gcc/go/gofrontend/lex.cc
gcc/go/gofrontend/lex.h