diff --git a/.github/workflows/test-sys.yaml b/.github/workflows/test-sys.yaml index 9be428ebd23..46d4a769798 100644 --- a/.github/workflows/test-sys.yaml +++ b/.github/workflows/test-sys.yaml @@ -219,7 +219,7 @@ jobs: make test-integration-cli env: TARGET: x86_64-pc-windows-msvc - TARGET_DIR: TARGET_DIR: target/x86_64-pc-windows-msvc/release + TARGET_DIR: target/x86_64-pc-windows-msvc/release CARGO_TARGET: --target x86_64-pc-windows-msvc - name: Test if: matrix.run_test && matrix.os != 'windows-2019' diff --git a/lib/compiler-singlepass/src/emitter_arm64.rs b/lib/compiler-singlepass/src/emitter_arm64.rs index 18946e89351..23ca12c45d5 100644 --- a/lib/compiler-singlepass/src/emitter_arm64.rs +++ b/lib/compiler-singlepass/src/emitter_arm64.rs @@ -3198,8 +3198,10 @@ pub fn gen_std_trampoline_arm64( ; ret ); + let mut body = a.finalize().unwrap(); + body.shrink_to_fit(); Ok(FunctionBody { - body: a.finalize().unwrap().to_vec(), + body, unwind_info: None, }) } @@ -3353,8 +3355,10 @@ pub fn gen_std_dynamic_import_trampoline_arm64( // Return. a.emit_ret()?; + let mut body = a.finalize().unwrap(); + body.shrink_to_fit(); Ok(FunctionBody { - body: a.finalize().unwrap().to_vec(), + body, unwind_info: None, }) } @@ -3532,7 +3536,9 @@ pub fn gen_import_call_trampoline_arm64( } a.emit_b_register(GPR::X16)?; - let section_body = SectionBody::new_with_vec(a.finalize().unwrap().to_vec()); + let mut contents = a.finalize().unwrap(); + contents.shrink_to_fit(); + let section_body = SectionBody::new_with_vec(contents); Ok(CustomSection { protection: CustomSectionProtection::ReadExecute, diff --git a/lib/compiler-singlepass/src/machine_x64.rs b/lib/compiler-singlepass/src/machine_x64.rs index 58b2422924b..2bfeaa9d6d6 100644 --- a/lib/compiler-singlepass/src/machine_x64.rs +++ b/lib/compiler-singlepass/src/machine_x64.rs @@ -7736,8 +7736,10 @@ impl Machine for MachineX86_64 { a.emit_ret()?; + let mut body = a.finalize().unwrap(); + body.shrink_to_fit(); Ok(FunctionBody { - body: a.finalize().unwrap().to_vec(), + body, unwind_info: None, }) } @@ -7858,8 +7860,10 @@ impl Machine for MachineX86_64 { // Return. a.emit_ret()?; + let mut body = a.finalize().unwrap(); + body.shrink_to_fit(); Ok(FunctionBody { - body: a.finalize().unwrap().to_vec(), + body, unwind_info: None, }) } @@ -8024,7 +8028,9 @@ impl Machine for MachineX86_64 { } a.emit_host_redirection(GPR::RAX)?; - let section_body = SectionBody::new_with_vec(a.finalize().unwrap().to_vec()); + let mut contents = a.finalize().unwrap(); + contents.shrink_to_fit(); + let section_body = SectionBody::new_with_vec(contents); Ok(CustomSection { protection: CustomSectionProtection::ReadExecute,