Skip to content
Merged
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
3 changes: 2 additions & 1 deletion src/aml/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2865,7 +2865,8 @@ where
} else {
loop {
let Some(block) = context.block_stack.pop() else { Err(AmlError::ContinueOutsideOfWhile)? };
if let BlockKind::While { start_pc, start_nanos } = block.kind {
context.current_block = block;
if let BlockKind::While { start_pc, start_nanos } = context.current_block.kind {
context.current_block.pc = start_pc;
start = start_nanos;
break;
Expand Down
22 changes: 22 additions & 0 deletions tests/while.asl
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,33 @@ DefinitionBlock("while.aml", "DSDT", 1, "RSACPI", "WHILE", 1) {
CHEK(Local0, 0)
}

Method(T5) {
// Test `Continue` from within an If block (adapted from uACPI's `while-continue.asl`)
Local0 = 1
Local1 = 10

While (Local0) {
If (Local1--) {
Debug = "Incrementing Local0 & continuing"
Local0++
Debug = Local0
Continue
}

Debug = "Local1 is 0, breaking"
Break
}

CHEK(Local0, 10)
CHEK(Local1, 0)
}

Method(MAIN) {
T1()
T2()
T3()
T4()
T5()

Return(FCNT)
}
Expand Down
Loading