mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-03-28 07:51:07 +00:00
Merge pull request #752 from alexcrichton/remove-hack
Remove a hack around an LLVM bug
This commit is contained in:
commit
9fc43f8a19
@ -322,7 +322,6 @@ fn extract_programs(module: &mut Module) -> Result<Vec<shared::Program>, Error>
|
|||||||
to_remove.push(i);
|
to_remove.push(i);
|
||||||
|
|
||||||
let mut payload = custom.payload();
|
let mut payload = custom.payload();
|
||||||
let mut added_programs = Vec::new();
|
|
||||||
while payload.len() > 0 {
|
while payload.len() > 0 {
|
||||||
let len = ((payload[0] as usize) << 0)
|
let len = ((payload[0] as usize) << 0)
|
||||||
| ((payload[1] as usize) << 8)
|
| ((payload[1] as usize) << 8)
|
||||||
@ -331,19 +330,6 @@ fn extract_programs(module: &mut Module) -> Result<Vec<shared::Program>, Error>
|
|||||||
let (a, b) = payload[4..].split_at(len as usize);
|
let (a, b) = payload[4..].split_at(len as usize);
|
||||||
payload = b;
|
payload = b;
|
||||||
|
|
||||||
// Due to a nasty LLVM bug it's currently possible for LLVM to
|
|
||||||
// duplicate custom section directives in intermediate object files.
|
|
||||||
// This means that we could see multiple program directives when in
|
|
||||||
// fact we were originally only meant to see one!
|
|
||||||
//
|
|
||||||
// Work around the issue here until the upstream bug,
|
|
||||||
// https://bugs.llvm.org/show_bug.cgi?id=38184, is hopefully fixed
|
|
||||||
// via some other means.
|
|
||||||
if added_programs.iter().any(|p| a == *p) {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
added_programs.push(a);
|
|
||||||
|
|
||||||
let p: shared::ProgramOnlySchema = match serde_json::from_slice(&a) {
|
let p: shared::ProgramOnlySchema = match serde_json::from_slice(&a) {
|
||||||
Ok(f) => f,
|
Ok(f) => f,
|
||||||
Err(e) => bail!("failed to decode what looked like wasm-bindgen data: {}", e),
|
Err(e) => bail!("failed to decode what looked like wasm-bindgen data: {}", e),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user