File tree Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change 201201 (local.set $len (i32.sub (local.get $len ) (i32.const 1 )))
202202 (local.set $pos (i32.add (local.get $pos ) (i32.const 1 )))
203203 (br $loop ))))
204- (ref.i31 (i32.const -1 )))
204+ (ref.i31 (i32.const -1 )))
205+
206+ (func (export " caml_bigstring_memrchr" )
207+ (param $s (ref eq)) (param $vc (ref eq))
208+ (param $vpos (ref eq)) (param $vlen (ref eq)) (result (ref eq))
209+ (local $pos i32 ) (local $len i32 ) (local $c i32 ) (local $cur i32 )
210+ (local $d (ref extern ))
211+ (local.set $c (i31.get_s (ref.cast (ref i31) (local.get $vc ))))
212+ (local.set $pos (i31.get_s (ref.cast (ref i31) (local.get $vpos ))))
213+ (local.set $len (i31.get_s (ref.cast (ref i31) (local.get $vlen ))))
214+ (local.set $d (call $caml_ba_get_data (local.get $s )))
215+ (local.set $cur
216+ (i32.sub (i32.add (local.get $pos ) (local.get $len )) (i32.const 1 )))
217+ (loop $loop
218+ (if (i32.ge_s (local.get $cur ) (local.get $pos ))
219+ (then
220+ (if (i32.eq (local.get $c )
221+ (call $ta_get_ui8 (local.get $d ) (local.get $cur )))
222+ (then
223+ (return (ref.i31 (local.get $cur )))))
224+ (local.set $cur (i32.sub (local.get $cur ) (i32.const 1 )))
225+ (br $loop ))))
226+ (ref.i31 (i32.const -1 )))
205227
206228 (export " caml_bigstring_blit_string_to_ba"
207229 (func $caml_bigstring_blit_bytes_to_ba ))
You can’t perform that action at this time.
0 commit comments