Fix the get_code/1-2 predicates to return -1 at the end of stream

This commit is contained in:
Paulo Moura
2021-11-06 19:41:25 +00:00
parent 67ef5fe8e6
commit 658b835a70

View File

@@ -2443,10 +2443,10 @@ impl MachineState {
}
if stream.at_end_of_stream() {
let end_of_file = clause_name!("end_of_file");
let end_of_file = Integer::from(-1);
let end_of_file = self
.heap
.to_unifiable(HeapCellValue::Atom(end_of_file, None));
.to_unifiable(HeapCellValue::Integer(Rc::new(end_of_file)));
stream.set_past_end_of_stream();