diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/go/gofrontend/MERGE | 2 | ||||
-rw-r--r-- | gcc/go/gofrontend/expressions.cc | 10 |
2 files changed, 10 insertions, 2 deletions
diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index 3e94dab..c14ee7e 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -78c9a657fdbc9e812d39910fb93fbae4affe4360 +8cbe18aff99dbf79bd1adb9c025418e84505ffd5 The first line of this file holds the git revision number of the last merge done from the gofrontend repository. diff --git a/gcc/go/gofrontend/expressions.cc b/gcc/go/gofrontend/expressions.cc index 6bc9348..448888b 100644 --- a/gcc/go/gofrontend/expressions.cc +++ b/gcc/go/gofrontend/expressions.cc @@ -4024,8 +4024,16 @@ Type_conversion_expression::do_string_constant_value(std::string* val) const unsigned long ival; if (nc.to_unsigned_long(&ival) == Numeric_constant::NC_UL_VALID) { + unsigned int cval = static_cast<unsigned int>(ival); + if (static_cast<unsigned long>(cval) != ival) + { + go_warning_at(this->location(), 0, + "unicode code point 0x%lx out of range", + ival); + cval = 0xfffd; // Unicode "replacement character." + } val->clear(); - Lex::append_char(ival, true, val, this->location()); + Lex::append_char(cval, true, val, this->location()); return true; } } |