Skip to content

Commit 4f4da74

Browse files
committed
Remove a hack around an LLVM bug
This has since been fixed in rust-lang/rust#52506
1 parent 8ce7465 commit 4f4da74

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

crates/cli-support/src/lib.rs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,6 @@ fn extract_programs(module: &mut Module) -> Result<Vec<shared::Program>, Error>
321321
to_remove.push(i);
322322

323323
let mut payload = custom.payload();
324-
let mut added_programs = Vec::new();
325324
while payload.len() > 0 {
326325
let len = ((payload[0] as usize) << 0)
327326
| ((payload[1] as usize) << 8)
@@ -330,19 +329,6 @@ fn extract_programs(module: &mut Module) -> Result<Vec<shared::Program>, Error>
330329
let (a, b) = payload[4..].split_at(len as usize);
331330
payload = b;
332331

333-
// Due to a nasty LLVM bug it's currently possible for LLVM to
334-
// duplicate custom section directives in intermediate object files.
335-
// This means that we could see multiple program directives when in
336-
// fact we were originally only meant to see one!
337-
//
338-
// Work around the issue here until the upstream bug,
339-
// https://bugs.llvm.org/show_bug.cgi?id=38184, is hopefully fixed
340-
// via some other means.
341-
if added_programs.iter().any(|p| a == *p) {
342-
continue
343-
}
344-
added_programs.push(a);
345-
346332
let p: shared::ProgramOnlySchema = match serde_json::from_slice(&a) {
347333
Ok(f) => f,
348334
Err(e) => bail!("failed to decode what looked like wasm-bindgen data: {}", e),

0 commit comments

Comments
 (0)