File tree 2 files changed +9
-9
lines changed
2 files changed +9
-9
lines changed Original file line number Diff line number Diff line change 1
1
help : # # Display this help screen
2
2
@grep -h -E ' ^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST ) | awk ' BEGIN {FS = ":.*?## "}; {printf "\033[36m%-15s\033[0m %s\n", $$1, $$2}'
3
3
4
- COMPILER_VERSION =v0.1 .0
4
+ COMPILER_VERSION =v0.2 .0
5
5
6
6
setup-compiler : # # Setup the Dusk Contract Compiler
7
7
@./scripts/setup-compiler.sh $(COMPILER_VERSION )
Original file line number Diff line number Diff line change @@ -22,21 +22,21 @@ use crate::{
22
22
pub mod arg_buf {
23
23
use crate :: ARGBUF_LEN ;
24
24
25
+ use core:: ptr;
26
+ use core:: slice;
27
+
25
28
#[ no_mangle]
26
29
static mut A : [ u64 ; ARGBUF_LEN / 8 ] = [ 0 ; ARGBUF_LEN / 8 ] ;
27
30
28
31
pub fn with_arg_buf < F , R > ( f : F ) -> R
29
32
where
30
33
F : FnOnce ( & mut [ u8 ] ) -> R ,
31
34
{
32
- let buf = unsafe { & mut A } ;
33
- let first = & mut buf[ 0 ] ;
34
- let slice = unsafe {
35
- let first_byte: & mut u8 = core:: mem:: transmute ( first) ;
36
- core:: slice:: from_raw_parts_mut ( first_byte, ARGBUF_LEN )
37
- } ;
38
-
39
- f ( slice)
35
+ unsafe {
36
+ let addr = ptr:: addr_of_mut!( A ) ;
37
+ let slice = slice:: from_raw_parts_mut ( addr as _ , ARGBUF_LEN ) ;
38
+ f ( slice)
39
+ }
40
40
}
41
41
}
42
42
You can’t perform that action at this time.
0 commit comments