public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Andreas Schwab <schwab@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc r11-8273] Fix endian bug in rust demangler Date: Wed, 21 Apr 2021 11:31:45 +0000 (GMT) [thread overview] Message-ID: <20210421113145.CC222385800A@sourceware.org> (raw) https://gcc.gnu.org/g:4cdb510fb0d4e285b0565f402883025998ba6250 commit r11-8273-g4cdb510fb0d4e285b0565f402883025998ba6250 Author: Andreas Schwab <schwab@linux-m68k.org> Date: Tue Apr 20 17:30:46 2021 +0200 Fix endian bug in rust demangler libiberty/ PR demangler/100177 * rust-demangle.c (demangle_const_char): Properly print the character value. Diff: --- libiberty/rust-demangle.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libiberty/rust-demangle.c b/libiberty/rust-demangle.c index 6fd8f6a4db0..449941b56dc 100644 --- a/libiberty/rust-demangle.c +++ b/libiberty/rust-demangle.c @@ -1253,9 +1253,12 @@ demangle_const_char (struct rust_demangler *rdm) else if (value == '\n') PRINT ("\\n"); else if (value > ' ' && value < '~') - /* Rust also considers many non-ASCII codepoints to be printable, but - that logic is not easily ported to C. */ - print_str (rdm, (char *) &value, 1); + { + /* Rust also considers many non-ASCII codepoints to be printable, but + that logic is not easily ported to C. */ + char c = value; + print_str (rdm, &c, 1); + } else { PRINT ("\\u{");
reply other threads:[~2021-04-21 11:31 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20210421113145.CC222385800A@sourceware.org \ --to=schwab@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).