@@ -14,7 +14,7 @@ let require b at s = if not b then error at s
14
14
15
15
(* Context *)
16
16
17
- type label_kind = BodyLabel | BlockLabel | TryLabel | CatchLabel
17
+ type label_kind = BlockLabel | CatchLabel
18
18
19
19
type context =
20
20
{
@@ -409,7 +409,7 @@ let rec check_instr (c : context) (e : instr) (s : infer_stack_type) : op_type =
409
409
410
410
| TryCatch (bt , es , cts , ca ) ->
411
411
let FuncType (ts1, ts2) as ft = check_block_type c bt in
412
- let c_try = {c with labels = (TryLabel , ts2) :: c.labels} in
412
+ let c_try = {c with labels = (BlockLabel , ts2) :: c.labels} in
413
413
let c_catch = {c with labels = (CatchLabel , ts2) :: c.labels} in
414
414
check_block c_try es ft e.at;
415
415
List. iter (fun ct -> check_catch ct c_catch ft e.at) cts;
@@ -419,8 +419,8 @@ let rec check_instr (c : context) (e : instr) (s : infer_stack_type) : op_type =
419
419
| TryDelegate (bt , es , x ) ->
420
420
let FuncType (ts1, ts2) as ft = check_block_type c bt in
421
421
let (kind, _) = label c x in
422
- require (kind = TryLabel || kind = BodyLabel ) e.at " invalid delegate label" ;
423
- check_block {c with labels = (TryLabel , ts2) :: c.labels} es ft e.at;
422
+ require (kind = BlockLabel ) e.at " invalid delegate label" ;
423
+ check_block {c with labels = (BlockLabel , ts2) :: c.labels} es ft e.at;
424
424
ts1 --> ts2
425
425
426
426
| Throw x ->
@@ -524,7 +524,7 @@ let check_type (t : type_) =
524
524
let check_func (c : context ) (f : func ) =
525
525
let {ftype; locals; body} = f.it in
526
526
let FuncType (ts1, ts2) = type_ c ftype in
527
- let c' = {c with locals = ts1 @ locals; results = ts2; labels = [(BodyLabel , ts2)]} in
527
+ let c' = {c with locals = ts1 @ locals; results = ts2; labels = [(BlockLabel , ts2)]} in
528
528
check_block c' body (FuncType ([] , ts2)) f.at
529
529
530
530
let check_tag (c : context ) (t : tag ) =
0 commit comments