File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -3072,9 +3072,19 @@ impl Machine {
30723072 }
30733073 & Instruction :: UnifyVoid ( n) => {
30743074 match self . machine_st . mode {
3075- MachineMode :: Read => {
3076- self . machine_st . s_offset += n;
3077- }
3075+ MachineMode :: Read => match & self . machine_st . s {
3076+ HeapPtr :: HeapCell ( _) => self . machine_st . s_offset += n,
3077+ & HeapPtr :: PStr ( pstr_loc) => {
3078+ debug_assert ! ( n <= 2 ) ;
3079+ let mut char_iter = self . machine_st . heap . char_iter ( pstr_loc) ;
3080+
3081+ // this only matters in the case that n == 1, but the case
3082+ // analysis isn't worth doing since the effect is benign if n ==
3083+ // 2
3084+ self . machine_st . s_offset +=
3085+ char_iter. next ( ) . unwrap ( ) . len_utf8 ( ) ;
3086+ }
3087+ } ,
30783088 MachineMode :: Write => {
30793089 let h = self . machine_st . heap . cell_len ( ) ;
30803090
You can’t perform that action at this time.
0 commit comments