Skip to content

Commit

Permalink
Merge pull request #9 from OCamlPro/tmpfuzzing
Browse files Browse the repository at this point in the history
fix parser+typecheck bug
  • Loading branch information
epatrizio authored Jul 3, 2023
2 parents 84b77a2 + 44769ad commit 41fd0c2
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
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

0 comments on commit 41fd0c2

Please sign in to comment.