We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 09fe883 commit 6590304Copy full SHA for 6590304
1 file changed
lib/codegen.ml
@@ -436,13 +436,7 @@ let rec gen_expr (ctx : context) (expr : expr) : (context * instr list) result =
436
UnboundVariable even though the parser accepts it. *)
437
begin match List.assoc_opt id.name ctx.variant_tags with
438
| Some tag -> Ok (ctx, [I32Const (Int32.of_int tag)])
439
- | None ->
440
- (* Top-level const bindings are stored in func_indices with a
441
- negative sentinel: actual global index = -(k+1). *)
442
- begin match List.assoc_opt id.name ctx.func_indices with
443
- | Some k when k < 0 -> Ok (ctx, [GlobalGet (-(k + 1))])
444
- | _ -> Error (UnboundVariable id.name)
445
- end
+ | None -> Error (UnboundVariable id.name)
446
end
447
448
0 commit comments