Skip to content

Commit 8d2a081

Browse files
committed
FIX
1 parent 5682bd1 commit 8d2a081

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
@@ -537,8 +537,11 @@ and expression_type (e : W.expression) st =
537537
| Br_on_null _ -> None, st
538538
| LocalGet x | LocalTee (x, _) -> variable_type x st
539539
| GlobalGet x ->
540-
let typ = (Var.Map.find x st.context.constant_globals).typ in
541-
(if Poly.equal typ st.context.value_type then None else Some typ), st
540+
( (try
541+
let typ = (Var.Map.find x st.context.constant_globals).typ in
542+
if Poly.equal typ st.context.value_type then None else Some typ
543+
with Not_found -> None)
544+
, st )
542545
| Seq (_, e') -> expression_type e' st
543546
| Pop typ -> Some typ, st
544547
| RefI31 _ -> Some (Ref { nullable = false; typ = I31 }), st

0 commit comments

Comments
 (0)