Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/aml/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2778,14 +2778,14 @@ struct MethodContext {
}

struct Block {
stream: *const [u8],
stream: Vec<u8>,
pc: usize,
kind: BlockKind,
}

impl Block {
fn stream(&self) -> &[u8] {
unsafe { &*self.stream }
&self.stream
}
}

Expand Down Expand Up @@ -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(),
Expand All @@ -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() },
};
Expand Down Expand Up @@ -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,
};
Expand Down
1 change: 0 additions & 1 deletion tests/uacpi_examples.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Loading