File tree Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -4812,11 +4812,11 @@ impl Machine {
4812
4812
step_or_fail ! ( self , self . machine_st. p = self . machine_st. cp) ;
4813
4813
}
4814
4814
& Instruction :: CallLoadContextModule => {
4815
- self . load_context_module ( self . machine_st . registers [ 1 ] ) ;
4815
+ self . load_context_module ( self . deref_register ( 1 ) ) ;
4816
4816
step_or_fail ! ( self , self . machine_st. p += 1 ) ;
4817
4817
}
4818
4818
& Instruction :: ExecuteLoadContextModule => {
4819
- self . load_context_module ( self . machine_st . registers [ 1 ] ) ;
4819
+ self . load_context_module ( self . deref_register ( 1 ) ) ;
4820
4820
step_or_fail ! ( self , self . machine_st. p = self . machine_st. cp) ;
4821
4821
}
4822
4822
& Instruction :: CallLoadContextStream => {
Original file line number Diff line number Diff line change
1
+ :- initialization((M = user , loader :load_context(M ))).
Original file line number Diff line number Diff line change @@ -25,3 +25,11 @@ fn issue2588_load_html() {
25
25
fn call_qualification ( ) {
26
26
load_module_test ( "tests-pl/issue2361-call-qualified.pl" , "" ) ;
27
27
}
28
+
29
+ // PR #2756: ensures that calling load_context with a bound variable doesn't trigger unreachable!()
30
+ #[ serial]
31
+ #[ test]
32
+ #[ cfg_attr( miri, ignore = "it takes too long to run" ) ]
33
+ fn load_context_unreachable ( ) {
34
+ load_module_test ( "tests-pl/load-context-unreachable.pl" , "" ) ;
35
+ }
You can’t perform that action at this time.
0 commit comments