diff --git a/src/lib/bitfield.ml b/src/lib/bitfield.ml index 4d3d7029c..72458cadf 100644 --- a/src/lib/bitfield.ml +++ b/src/lib/bitfield.ml @@ -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; "}"; ] diff --git a/test/typecheck/pass/issue434.sail b/test/typecheck/pass/issue434.sail new file mode 100644 index 000000000..610e04f81 --- /dev/null +++ b/test/typecheck/pass/issue434.sail @@ -0,0 +1,9 @@ +default Order dec + +$include + +$option -strict_var + +bitfield b : bits(64) = { + B : 0 +}