Skip to content

Commit

Permalink
Merge branch 'main' into fix_200
Browse files Browse the repository at this point in the history
  • Loading branch information
bgregoir authored Jul 22, 2022
2 parents 7f4f0d0 + 4ea841e commit 3130e33
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 11 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
- Fix lowering of not-equal conditions in assignments
([PR #216](https://github.com/jasmin-lang/jasmin/pull/216);
fixes [#200](https://github.com/jasmin-lang/jasmin/issues/200)).

- Conditional function calls now produce a clearer error message
([PR #215](https://github.com/jasmin-lang/jasmin/pull/215);
fixes [#199](https://github.com/jasmin-lang/jasmin/issues/199)).

## New features

Expand Down
7 changes: 3 additions & 4 deletions compiler/src/pretyping.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1772,11 +1772,10 @@ let rec tt_instr pd asmOp (env : 'asm Env.env) ((annot,pi) : S.pinstr) : 'asm En
if peop2_of_eqop eqop <> None then rs_tyerror ~loc exn;
let cpi = S.PIAssign (ls, eqop, e, None) in
let env, i = tt_instr pd asmOp env (annot, L.mk_loc loc cpi) in
let i, is =
let x, ty, e, is =
match i with
| [] -> assert false
| i :: is -> i, is in
let x, _, ty, e = P.destruct_move i in
| { i_desc = P.Cassgn (x, _, ty, e) ; _ } :: is -> x, ty, e, is
| _ -> rs_tyerror ~loc exn in
let e' = ofdfl (fun _ -> rs_tyerror ~loc exn) (P.expr_of_lval x) in
let c = tt_expr_bool pd env cp in
env, mk_i (P.Cassgn (x, AT_none, ty, Pif (ty, c, e, e'))) :: is
Expand Down
5 changes: 0 additions & 5 deletions compiler/src/prog.ml
Original file line number Diff line number Diff line change
Expand Up @@ -562,11 +562,6 @@ let expr_of_lval = function
(* -------------------------------------------------------------------- *)
(* Functions over instruction *)

let destruct_move i =
match i.i_desc with
| Cassgn(x, tag, ty, e) -> x, tag, ty, e
| _ -> assert false

let rec has_syscall_i i =
match i.i_desc with
| Csyscall _ -> true
Expand Down
2 changes: 0 additions & 2 deletions compiler/src/prog.mli
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,6 @@ val expr_of_lval : 'len glval -> 'len gexpr option
(* -------------------------------------------------------------------- *)
(* Functions over instruction *)

val destruct_move : ('len, 'info, 'asm) ginstr -> 'len glval * E.assgn_tag * 'len gty * 'len gexpr

val has_syscall : ('len, 'info, 'asm) gstmt -> bool

(* -------------------------------------------------------------------- *)
Expand Down

0 comments on commit 3130e33

Please sign in to comment.