Fix UB caused by interactions with null streams

This commit is contained in:
Emilie Burgun
2025-01-31 17:26:40 +01:00
parent 079a69396a
commit fdc35f8b40
5 changed files with 136 additions and 53 deletions

View File

@@ -291,7 +291,7 @@ impl Machine {
}
fn load_file(&mut self, path: &str, stream: Stream) {
self.machine_st.registers[1] = stream_as_cell!(stream);
self.machine_st.registers[1] = stream.into();
self.machine_st.registers[2] =
atom_as_cell!(AtomTable::build_with(&self.machine_st.atom_tbl, path));