fix position property in stream_property/2 (#477)

This commit is contained in:
Mark Thom
2020-05-10 13:35:48 -06:00
parent 26d483f2d7
commit ea7b1a9592

View File

@@ -4709,12 +4709,8 @@ impl MachineState {
}
}
"position" => {
if stream.options.reposition {
if let Some(position) = stream.position() {
HeapCellValue::Addr(Addr::Usize(position as usize))
} else {
unreachable!()
}
if let Some(position) = stream.position() {
HeapCellValue::Addr(Addr::Usize(position as usize))
} else {
self.fail = true;
return Ok(());