Encapsulate accesses to IndexStore::streams and ::stream_aliases

These two fields are able to hold `Stream` instances, which predicates like `close/1`
expect to be managed properly for their correctness. To ensure that this is the case,
I have removed direct accesses to those two fields, so that they can be properly managed
in one place.
This commit is contained in:
Emilie Burgun
2025-02-03 14:00:37 +01:00
parent 2fe7b55343
commit 0cf46d3ec4
5 changed files with 187 additions and 124 deletions

View File

@@ -1808,7 +1808,7 @@ impl Machine {
pub(crate) fn push_load_context(&mut self) -> CallResult {
let stream = self.machine_st.get_stream_or_alias(
self.machine_st.registers[1],
&self.indices.stream_aliases,
&self.indices,
atom!("$push_load_context"),
2,
)?;