Skip to content

Commit

Permalink
Fix bitfield generation with -strict_var
Browse files Browse the repository at this point in the history
  • Loading branch information
Alasdair committed Feb 1, 2024
1 parent 95a5254 commit 9fda0b9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/bitfield.ml
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ let register_field_setter typ_name field order range =
String.concat "\n"
[
Printf.sprintf "function %s (r_ref, v) = {" fun_id;
" r = __deref(r_ref);";
" let r = __deref(r_ref);";
Printf.sprintf " (*r_ref) = %s(r, v)" update_fun_id;
"}";
]
Expand Down
9 changes: 9 additions & 0 deletions test/typecheck/pass/issue434.sail
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
default Order dec

$include <prelude.sail>

$option -strict_var

bitfield b : bits(64) = {
B : 0
}

0 comments on commit 9fda0b9

Please sign in to comment.