stop fn on return

This commit is contained in:
Mylloon 2022-12-10 16:28:12 +01:00
parent c1d7a8e749
commit 16ee21d6d0
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -74,8 +74,11 @@ let rec analyze_block env ua ret_t = function
| [] -> [], ua
| instr :: new_block ->
let new_instr, new_env, ua1 = analyze_instr env ua ret_t instr in
let new_block, ua2 = analyze_block new_env ua1 ret_t new_block in
new_instr :: new_block, ua2
(match new_instr with
| Return _ -> [ new_instr ], ua1
| _ ->
let new_block, ua2 = analyze_block new_env ua1 ret_t new_block in
new_instr :: new_block, ua2)
;;
let analyze_func env ua = function