about summary refs log tree commit diff
path: root/src/librustc_codegen_utils
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-05-29 00:20:00 +0200
committerGitHub <noreply@github.com>2019-05-29 00:20:00 +0200
commitdae331d921d94da76a4ef240463d8b83b77121fb (patch)
treec4b01098da67fd7281fb3cd53ad010b495c5e015 /src/librustc_codegen_utils
parent745af720bb9824b5a1810d1326a3c4bbc8eef1e5 (diff)
parent9c34473ecf87a6f541b9f6404b782eaa484033d7 (diff)
downloadrust-dae331d921d94da76a4ef240463d8b83b77121fb.tar.gz
rust-dae331d921d94da76a4ef240463d8b83b77121fb.zip
Rollup merge of #61195 - davidtwco:seg-fault-mangler, r=eddyb
Special-case `.llvm` in mangler

Fixes #60925 and fixes #53912.

r? @michaelwoerister
cc @eddyb
Diffstat (limited to 'src/librustc_codegen_utils')
-rw-r--r--src/librustc_codegen_utils/symbol_names.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/librustc_codegen_utils/symbol_names.rs b/src/librustc_codegen_utils/symbol_names.rs
index bf81b7f0da5..211d725e39d 100644
--- a/src/librustc_codegen_utils/symbol_names.rs
+++ b/src/librustc_codegen_utils/symbol_names.rs
@@ -629,6 +629,9 @@ impl fmt::Write for SymbolPrinter<'_, '_> {
                 // for ':' and '-'
                 '-' | ':' => self.path.temp_buf.push('.'),
 
+                // Avoid segmentation fault on some platforms, see #60925.
+                'm' if self.path.temp_buf.ends_with(".llv") => self.path.temp_buf.push_str("$6d$"),
+
                 // These are legal symbols
                 'a'..='z' | 'A'..='Z' | '0'..='9' | '_' | '.' | '$' => self.path.temp_buf.push(c),