Skip to content

Commit 40490e3

Browse files
committed
[interpreter] Remove unused NullPat
1 parent 072bd0d commit 40490e3

4 files changed

Lines changed: 0 additions & 11 deletions

File tree

interpreter/script/js.ml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,6 @@ let type_of_vec_pat = function
435435
let type_of_ref_pat = function
436436
| RefPat ref -> type_of_ref ref.it
437437
| RefTypePat ht -> (NoNull, ht)
438-
| NullPat -> (Null, BotHT)
439438

440439
let rec type_of_result res =
441440
match res.it with
@@ -555,10 +554,6 @@ let assert_return ress ts at =
555554
[ RefTest (NoNull, t) @@ at;
556555
Test (I32 I32Op.Eqz) @@ at;
557556
BrIf (0l @@ at) @@ at ]
558-
| RefResult NullPat ->
559-
[ RefIsNull @@ at;
560-
Test (I32 I32Op.Eqz) @@ at;
561-
BrIf (0l @@ at) @@ at ]
562557
| EitherResult ress ->
563558
let idx = Lib.List32.length !locals in
564559
locals := !locals @ [Local t @@ res.at];
@@ -733,7 +728,6 @@ let of_vec_pat = function
733728
let of_ref_pat = function
734729
| RefPat r -> of_ref r.it
735730
| RefTypePat t -> "\"ref." ^ string_of_heaptype t ^ "\""
736-
| NullPat -> "\"ref.null\""
737731

738732
let rec of_result res =
739733
match res.it with

interpreter/script/runner.ml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,6 @@ let string_of_ref_pat (p : ref_pat) =
265265
match p with
266266
| RefPat r -> Value.string_of_ref r.it
267267
| RefTypePat t -> Types.string_of_heaptype t
268-
| NullPat -> "null"
269268

270269
let rec string_of_result r =
271270
match r.it with
@@ -286,7 +285,6 @@ let rec type_of_result r =
286285
| VecResult (VecPat v) -> Types.VecT (Value.type_of_vec v)
287286
| RefResult (RefPat r) -> Types.RefT (Value.type_of_ref r.it)
288287
| RefResult (RefTypePat t) -> Types.(RefT (NoNull, t)) (* assume closed *)
289-
| RefResult (NullPat) -> Types.(RefT (Null, ExternHT))
290288
| EitherResult rs ->
291289
let ts = List.map type_of_result rs in
292290
List.fold_left (fun t1 t2 ->
@@ -463,7 +461,6 @@ let assert_ref_pat r p =
463461
| RefTypePat Types.FuncHT, Instance.FuncRef _
464462
| RefTypePat Types.ExnHT, Exn.ExnRef _
465463
| RefTypePat Types.ExternHT, _ -> true
466-
| NullPat, Value.NullRef -> true
467464
| _ -> false
468465

469466
let rec assert_result v r =

interpreter/script/script.ml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ type vec_pat =
3030
type ref_pat =
3131
| RefPat of ref_
3232
| RefTypePat of Types.heaptype
33-
| NullPat
3433

3534
type result = result' Source.phrase
3635
and result' =

interpreter/text/arrange.ml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -851,7 +851,6 @@ let vec_pat mode = function
851851
let ref_pat = function
852852
| RefPat r -> ref_ r.it
853853
| RefTypePat t -> Node ("ref." ^ heaptype t, [])
854-
| NullPat -> Node ("ref.null", [])
855854

856855
let rec result mode res =
857856
match res.it with

0 commit comments

Comments
 (0)