diff --git a/impls/wasm/step8_macros.wam b/impls/wasm/step8_macros.wam index f8e58d3760..d50a5014e0 100644 --- a/impls/wasm/step8_macros.wam +++ b/impls/wasm/step8_macros.wam @@ -293,12 +293,15 @@ (then (local.set $a1 ($MAL_GET_A1 $ast)) (local.set $a2 ($MAL_GET_A2 $ast)) - (local.set $res ($EVAL $a2 $env)) + (local.set $f ($EVAL $a2 $env)) + (local.set $res ($MALFUNC ($MEM_VAL0_ptr $f) + ($MEM_VAL1_ptr $f) ($MEM_VAL2_ptr $f))) ($SET_TYPE $res (global.get $MACRO_T)) (br_if $EVAL_return (global.get $error_type)) + ($RELEASE $f) ;; set a1 in env to a2 - (local.set $res ($ENV_SET $env $a1 $res)) + (drop ($ENV_SET $env $a1 $res)) (br $EVAL_return)) ) (if (i32.eqz ($strcmp "if" $a0sym)) diff --git a/impls/wasm/step9_try.wam b/impls/wasm/step9_try.wam index 9ac89481d0..486906c2f8 100644 --- a/impls/wasm/step9_try.wam +++ b/impls/wasm/step9_try.wam @@ -293,12 +293,15 @@ (then (local.set $a1 ($MAL_GET_A1 $ast)) (local.set $a2 ($MAL_GET_A2 $ast)) - (local.set $res ($EVAL $a2 $env)) + (local.set $f ($EVAL $a2 $env)) + (local.set $res ($MALFUNC ($MEM_VAL0_ptr $f) + ($MEM_VAL1_ptr $f) ($MEM_VAL2_ptr $f))) ($SET_TYPE $res (global.get $MACRO_T)) (br_if $EVAL_return (global.get $error_type)) + ($RELEASE $f) ;; set a1 in env to a2 - (local.set $res ($ENV_SET $env $a1 $res)) + (drop ($ENV_SET $env $a1 $res)) (br $EVAL_return)) ) (if (i32.eqz ($strcmp "try*" $a0sym)) diff --git a/impls/wasm/stepA_mal.wam b/impls/wasm/stepA_mal.wam index 5276d26f40..9cd6dcdfd0 100644 --- a/impls/wasm/stepA_mal.wam +++ b/impls/wasm/stepA_mal.wam @@ -293,12 +293,15 @@ (then (local.set $a1 ($MAL_GET_A1 $ast)) (local.set $a2 ($MAL_GET_A2 $ast)) - (local.set $res ($EVAL $a2 $env)) + (local.set $f ($EVAL $a2 $env)) + (local.set $res ($MALFUNC ($MEM_VAL0_ptr $f) + ($MEM_VAL1_ptr $f) ($MEM_VAL2_ptr $f))) ($SET_TYPE $res (global.get $MACRO_T)) (br_if $EVAL_return (global.get $error_type)) + ($RELEASE $f) ;; set a1 in env to a2 - (local.set $res ($ENV_SET $env $a1 $res)) + (drop ($ENV_SET $env $a1 $res)) (br $EVAL_return)) ) (if (i32.eqz ($strcmp "try*" $a0sym))