don't allow [] as a stream alias, restore domain error on source sink for open/{3,4}

This commit is contained in:
Mark Thom
2021-11-28 14:53:39 -07:00
parent a87236fea2
commit 529c401eee
2 changed files with 16 additions and 3 deletions

View File

@@ -1231,7 +1231,12 @@ impl MachineState {
let alias = read_heap_cell!(self.store(MachineState::deref(self, alias)),
(HeapCellValueTag::Atom, (name, arity)) => {
debug_assert_eq!(arity, 0);
Some(name)
if name != atom!("[]") {
Some(name)
} else {
None
}
}
_ => {
None