Skip to content

Commit 2494eee

Browse files
committed
FIX
1 parent fdbf150 commit 2494eee

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

compiler/lib-wasm/code_generation.ml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -535,8 +535,11 @@ and expression_type (e : W.expression) st =
535535
| Try _ -> None, st
536536
| LocalGet x | LocalTee (x, _) -> variable_type x st
537537
| GlobalGet x ->
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), st
538+
( (try
539+
let typ = (Var.Map.find x st.context.constant_globals).typ in
540+
if Poly.equal typ st.context.value_type then None else Some typ
541+
with Not_found -> None)
542+
, st )
540543
| Seq (_, e') -> expression_type e' st
541544
| Pop typ -> Some typ, st
542545
| RefI31 _ -> Some (Ref { nullable = false; typ = I31 }), st

0 commit comments

Comments
 (0)