@@ -674,7 +674,7 @@ macro_rules! {macro_name} {{
674
674
lift_read = self . lift_from_memory ( "src" , & payload_type, & module) ;
675
675
start_read_sig = "fn future_read(_: u32, _: *mut u8) -> u32" . to_owned ( ) ;
676
676
start_read = "unsafe extern \" C\" fn start_read(future: u32, dst: *mut u8) \
677
- -> u32 { future_read(future, dst) }"
677
+ -> u32 { unsafe { future_read(future, dst) } }"
678
678
. to_owned ( ) ;
679
679
if sig. indirect_params {
680
680
lift_write = self . lift_from_memory (
@@ -686,7 +686,7 @@ macro_rules! {macro_name} {{
686
686
lower = format ! (
687
687
r#"
688
688
let (ptr, cleanup) = {runtime}::Cleanup::new(
689
- ::std::alloc::Layout::from_size_align_unchecked({size}, {align})
689
+ unsafe {{ ::std::alloc::Layout::from_size_align_unchecked({size}, {align}) }}
690
690
);
691
691
{body}
692
692
dst[0] = {async_support}::CoreVal {{ as_i32: ptr as isize as i32 }};
@@ -696,7 +696,7 @@ macro_rules! {macro_name} {{
696
696
start_write_sig = "fn future_write(_: u32, _: *const u8) -> u32" . to_owned ( ) ;
697
697
start_write = format ! (
698
698
"unsafe extern \" C\" fn start_write(future: u32, src: &{async_support}::LoweredWrite) \
699
- -> u32 {{ future_write(future, src[0].as_i32 as isize as *const u8) }}"
699
+ -> u32 {{ unsafe {{ future_write(future, src[0].as_i32 as isize as *const u8) }} }}"
700
700
) ;
701
701
} else {
702
702
lift_write = self . lift_flat (
@@ -738,7 +738,7 @@ macro_rules! {macro_name} {{
738
738
. join ( ", " ) ;
739
739
start_write = format ! (
740
740
"unsafe extern \" C\" fn start_write(future: u32, src: &{async_support}::LoweredWrite) \
741
- -> u32 {{ future_write(future, {args}) }}"
741
+ -> u32 {{ unsafe {{ future_write(future, {args}) }} }}"
742
742
) ;
743
743
}
744
744
} else {
@@ -749,11 +749,12 @@ macro_rules! {macro_name} {{
749
749
start_read_sig = format ! ( "fn future_read(_: u32) -> u32" ) ;
750
750
start_write_sig = format ! ( "fn future_write(_: u32) -> u32" ) ;
751
751
start_read = format ! (
752
- "unsafe extern \" C\" fn start_read(future: u32, _: *mut u8) -> u32 {{ future_read(future) }}"
752
+ "unsafe extern \" C\" fn start_read(future: u32, _: *mut u8) \
753
+ -> u32 {{ unsafe {{ future_read(future) }} }}"
753
754
) ;
754
755
start_write = format ! (
755
756
"unsafe extern \" C\" fn start_write(future: u32, _: &{async_support}::LoweredWrite) \
756
- -> u32 {{ future_write(future) }}"
757
+ -> u32 {{ unsafe {{ future_write(future) }} }}"
757
758
) ;
758
759
}
759
760
0 commit comments