Merge pull request #2756 from adri326/fix-load-context-unreachable
Fix load_context_module triggering unreachable!()
This commit is contained in:
@@ -4812,11 +4812,11 @@ impl Machine {
|
||||
step_or_fail!(self, self.machine_st.p = self.machine_st.cp);
|
||||
}
|
||||
&Instruction::CallLoadContextModule => {
|
||||
self.load_context_module(self.machine_st.registers[1]);
|
||||
self.load_context_module(self.deref_register(1));
|
||||
step_or_fail!(self, self.machine_st.p += 1);
|
||||
}
|
||||
&Instruction::ExecuteLoadContextModule => {
|
||||
self.load_context_module(self.machine_st.registers[1]);
|
||||
self.load_context_module(self.deref_register(1));
|
||||
step_or_fail!(self, self.machine_st.p = self.machine_st.cp);
|
||||
}
|
||||
&Instruction::CallLoadContextStream => {
|
||||
|
||||
1
tests-pl/load-context-unreachable.pl
Normal file
1
tests-pl/load-context-unreachable.pl
Normal file
@@ -0,0 +1 @@
|
||||
:- initialization((M = user, loader:load_context(M))).
|
||||
@@ -25,3 +25,11 @@ fn issue2588_load_html() {
|
||||
fn call_qualification() {
|
||||
load_module_test("tests-pl/issue2361-call-qualified.pl", "");
|
||||
}
|
||||
|
||||
// PR #2756: ensures that calling load_context with a bound variable doesn't trigger unreachable!()
|
||||
#[serial]
|
||||
#[test]
|
||||
#[cfg_attr(miri, ignore = "it takes too long to run")]
|
||||
fn load_context_unreachable() {
|
||||
load_module_test("tests-pl/load-context-unreachable.pl", "");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user