File tree 2 files changed +6
-1
lines changed
2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change 17
17
(func $caml_wrap_exception (param externref ) (result (ref eq))))
18
18
(import " stdlib" " caml_main_wrapper"
19
19
(global $caml_main_wrapper (mut (ref null $wrapper_func ))))
20
+ (import " effect" " effect_allowed" (global $effect_allowed (mut i32 )))
20
21
21
22
(type $block (array (mut (ref eq))))
22
23
(type $string (array (mut i8 )))
180
181
181
182
(func (export " %perform" ) (param $eff (ref eq)) (result (ref eq))
182
183
(local $res (tuple (ref eq) (ref eq)))
184
+ (if (i32.eqz (global.get $effect_allowed ))
185
+ (then
186
+ (return_call $raise_unhandled
187
+ (local.get $eff ) (ref.i31 (i32.const 0 )))))
183
188
(local.set $res (suspend $effect (local.get $eff )))
184
189
(return_call_ref $function_1 (tuple.extract 2 1 (local.get $res ))
185
190
(tuple.extract 2 0 (local.get $res ))
Original file line number Diff line number Diff line change 80
80
(call $caml_fresh_oo_id (ref.i31 (i32.const 0 )))))
81
81
(ref.i31 (i32.const 0 )))
82
82
83
- (global $effect_allowed (mut i32 ) (i32.const 1 ))
83
+ (global $effect_allowed (export " effect_allowed " ) ( mut i32 ) (i32.const 1 ))
84
84
85
85
(@if (not wasi)
86
86
(@then
You can’t perform that action at this time.
0 commit comments