From b5c96bf426a724c87ba11d42a6daff93445d4251 Mon Sep 17 00:00:00 2001 From: losfair Date: Mon, 4 May 2020 23:25:25 +0800 Subject: [PATCH] Fix compilation error after merge --- lib/compiler-singlepass/src/codegen_x64.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/compiler-singlepass/src/codegen_x64.rs b/lib/compiler-singlepass/src/codegen_x64.rs index bf298699e..77089f396 100644 --- a/lib/compiler-singlepass/src/codegen_x64.rs +++ b/lib/compiler-singlepass/src/codegen_x64.rs @@ -20,7 +20,7 @@ use wasmer_compiler::wasmparser::{ use wasmer_compiler::{ CodeOffset, CompiledFunction, CompiledFunctionUnwindInfo, CustomSection, CustomSectionProtection, FunctionBody, Relocation, RelocationKind, RelocationTarget, - SectionIndex, + SectionIndex, SectionBody, }; use wasmer_runtime::{MemoryPlan, MemoryStyle, Module, TablePlan, TableStyle, TrapCode}; @@ -8408,9 +8408,12 @@ pub fn gen_import_call_trampoline(index: FuncIndex, sig: FuncType) -> CustomSect ); a.emit_host_redirection(GPR::RAX); + let mut section_body = SectionBody::default(); + section_body.extend(&a.finalize().unwrap()); + CustomSection { protection: CustomSectionProtection::ReadExecute, - bytes: a.finalize().unwrap().to_vec(), + bytes: section_body, } }