diff --git a/src/aml/mod.rs b/src/aml/mod.rs index 65707db8..d489e6b0 100644 --- a/src/aml/mod.rs +++ b/src/aml/mod.rs @@ -2778,14 +2778,14 @@ struct MethodContext { } struct Block { - stream: *const [u8], + stream: Vec, pc: usize, kind: BlockKind, } impl Block { fn stream(&self) -> &[u8] { - unsafe { &*self.stream } + &self.stream } } @@ -2911,7 +2911,7 @@ impl OpInFlight { impl MethodContext { unsafe fn new_from_table(stream: &[u8]) -> MethodContext { - let block = Block { stream: stream as *const [u8], pc: 0, kind: BlockKind::Table }; + let block = Block { stream: Vec::from(stream), pc: 0, kind: BlockKind::Table }; MethodContext { current_block: block, block_stack: Vec::new(), @@ -2933,7 +2933,7 @@ impl MethodContext { return Err(AmlError::MethodArgCountIncorrect); } let block = Block { - stream: code as &[u8] as *const [u8], + stream: code.clone(), pc: 0, kind: BlockKind::Method { method_scope: scope.clone() }, }; @@ -2981,7 +2981,7 @@ impl MethodContext { fn start_new_block(&mut self, kind: BlockKind, length: usize) { let block = Block { - stream: &self.current_block.stream()[..(self.current_block.pc + length)] as *const [u8], + stream: self.current_block.stream()[..(self.current_block.pc + length)].into(), pc: self.current_block.pc, kind, }; diff --git a/tests/uacpi_examples.rs b/tests/uacpi_examples.rs index 4d76d669..d5050aa0 100644 --- a/tests/uacpi_examples.rs +++ b/tests/uacpi_examples.rs @@ -181,7 +181,6 @@ DefinitionBlock("", "DSDT", 1, "RSACPI", "UACPI", 1) { } #[test] -#[ignore] // See issue #300 fn copy_object_to_self() { const ASL: &str = r#" DefinitionBlock("", "DSDT", 1, "RSACPI", "UACPI", 1) {