diff options
author | Takashi Kokubun <takashikkbn@gmail.com> | 2022-11-15 00:11:44 -0800 |
---|---|---|
committer | Takashi Kokubun <takashikkbn@gmail.com> | 2022-11-15 00:34:00 -0800 |
commit | 1a9e87fe3a0bb8a4a16e34997371b1823557202d (patch) | |
tree | a4c01edd23fa8dc91a3002fba3516b0818f40122 /tool | |
parent | f500ca9b8a62599433f7087fe1da30ec16e3564c (diff) |
MJIT: Fix vm_cc_cme(cc).def.type to use bit field
access properly. Because the libclang node had two children, it wasn't
handled well by the pattern matching for the bit field case.
In addition to that, this bit field has a non-1 width. Because we're
returning true/false for a width-1 bit field, I added another behavior
that works like a char value for bit fields with width 2-8.
Diffstat (limited to 'tool')
-rwxr-xr-x | tool/mjit/bindgen.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tool/mjit/bindgen.rb b/tool/mjit/bindgen.rb index 5ffe7166bc..6167bdfc00 100755 --- a/tool/mjit/bindgen.rb +++ b/tool/mjit/bindgen.rb @@ -224,7 +224,7 @@ class BindingGenerator case child # BitField is struct-specific. So it must be handled here. - in Node[kind: :field_decl, spelling:, bitwidth:, children: [_grandchild]] if bitwidth > 0 + in Node[kind: :field_decl, spelling:, bitwidth:, children: [_grandchild, *]] if bitwidth > 0 buf << field_builder.call(spelling, "CType::BitField.new(#{bitwidth}, #{node.offsetof.fetch(spelling) % 8})") # "(unnamed ...)" struct and union are handled here, which are also struct-specific. in Node[kind: :field_decl, spelling:, type:, children: [grandchild]] if type.match?(/\((unnamed|anonymous) [^)]+\)\z/) |