Skip to content

Commit d6b47f6

Browse files
authored
Merge pull request #1 from tylerhou/fix-bril-ocaml
Fix some bril-ocaml bugs
2 parents e22c20d + 15f3386 commit d6b47f6

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

bril-ocaml/lib/func.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ module Dominance = struct
204204
end
205205

206206
module Lists : S with type out := string list = struct
207-
let f = Map.map ~f:String.Set.to_list
207+
let f = Map.map ~f:Set.to_list
208208
let dominators ?strict = Fn.compose f (Sets.dominators ?strict)
209209
let dominated ?strict = Fn.compose f (Sets.dominated ?strict)
210210

bril-ocaml/lib/instr.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ let to_json =
236236
`Assoc
237237
[
238238
("op", `String "ret");
239-
("args", Option.value_map arg ~default:`Null ~f:(fun arg -> `List [ `String arg ]));
239+
("args", Option.value_map arg ~default:(`List []) ~f:(fun arg -> `List [ `String arg ]));
240240
]
241241
| Print args ->
242242
`Assoc [ ("op", `String "print"); ("args", `List (List.map args ~f:(fun arg -> `String arg))) ]
@@ -257,5 +257,5 @@ let to_json =
257257
| Alloc (dest, arg) -> build_op ~op:"alloc" ~args:[ arg ] ~dest ()
258258
| Free arg -> build_op ~op:"free" ~args:[ arg ] ()
259259
| Load (dest, arg) -> build_op ~op:"load" ~args:[ arg ] ~dest ()
260-
| Store (arg1, arg2) -> build_op ~op:"load" ~args:[ arg1; arg2 ] ()
260+
| Store (arg1, arg2) -> build_op ~op:"store" ~args:[ arg1; arg2 ] ()
261261
| PtrAdd (dest, arg1, arg2) -> build_op ~op:"ptradd" ~args:[ arg1; arg2 ] ~dest ()

0 commit comments

Comments
 (0)