Skip to content

Commit 015b228

Browse files
committed
FIX
1 parent b9416af commit 015b228

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

compiler/lib-wasm/code_generation.ml

+5-2
Original file line numberDiff line numberDiff line change
@@ -534,8 +534,11 @@ and expression_type (e : W.expression) st =
534534
| Try _ -> None, st
535535
| LocalGet x | LocalTee (x, _) -> variable_type x st
536536
| GlobalGet x ->
537-
let typ = (Var.Map.find x st.context.constant_globals).typ in
538-
(if Poly.equal typ st.context.value_type then None else Some typ), st
537+
( (try
538+
let typ = (Var.Map.find x st.context.constant_globals).typ in
539+
if Poly.equal typ st.context.value_type then None else Some typ
540+
with Not_found -> None)
541+
, st )
539542
| Seq (_, e') -> expression_type e' st
540543
| Pop typ -> Some typ, st
541544
| RefI31 _ -> Some (Ref { nullable = false; typ = I31 }), st

0 commit comments

Comments
 (0)