Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix parser+typecheck bug #9

Merged
merged 1 commit into from
Jul 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/menhir_parser.mly
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@ let expr_aux ==
let bt = match pt, rt with
| [], [] -> bt
| pt, rt ->
let pt = List.rev_map (fun t -> None, t) pt in
let pt = List.map (fun t -> None, t) pt in
let raw = pt, rt in
begin match bt with
| Some (Arg.Bt_ind type_use) -> Some (bt_raw (Some type_use) raw)
Expand Down
3 changes: 0 additions & 3 deletions src/typecheck.ml
Original file line number Diff line number Diff line change
Expand Up @@ -284,9 +284,6 @@ let rec typecheck_instr (env : env) (stack : stack) (instr : instr) :
let t = Env.global_get i env in
Stack.pop [ typ_of_val_type t ] stack
| If_else (_id, block_type, e1, e2) ->
let block_type =
Option.map (fun (pt, rt) -> (List.rev pt, rt)) block_type
in
let* stack = Stack.pop [ i32 ] stack in
let* stack_e1 = typecheck_expr env e1 ~is_loop:false block_type ~stack in
let* _stack_e2 = typecheck_expr env e2 ~is_loop:false block_type ~stack in
Expand Down