Skip to content

Commit c63377d

Browse files
author
Eduardo Leegwater Simões
authored
Merge pull request #318 from dusk-network/duskc-0.2.0
Update `duskc` to `0.2.0`
2 parents 61464cf + 343444d commit c63377d

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
help: ## Display this help screen
22
@grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-15s\033[0m %s\n", $$1, $$2}'
33

4-
COMPILER_VERSION=v0.1.0
4+
COMPILER_VERSION=v0.2.0
55

66
setup-compiler: ## Setup the Dusk Contract Compiler
77
@./scripts/setup-compiler.sh $(COMPILER_VERSION)

piecrust-uplink/src/abi/state.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,21 @@ use crate::{
2222
pub mod arg_buf {
2323
use crate::ARGBUF_LEN;
2424

25+
use core::ptr;
26+
use core::slice;
27+
2528
#[no_mangle]
2629
static mut A: [u64; ARGBUF_LEN / 8] = [0; ARGBUF_LEN / 8];
2730

2831
pub fn with_arg_buf<F, R>(f: F) -> R
2932
where
3033
F: FnOnce(&mut [u8]) -> R,
3134
{
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+
}
4040
}
4141
}
4242

0 commit comments

Comments
 (0)