Skip to content

Commit

Permalink
Support 128-bit reprs
Browse files Browse the repository at this point in the history
  • Loading branch information
mkrasnitski committed May 24, 2024
1 parent 0316264 commit 27bd9aa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 3 additions & 3 deletions rust/binaryninja-derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,11 @@ impl Repr {
let content;
parenthesized!(content in meta.input);
align = Some(content.parse::<LitInt>()?);
} else if ident_in_list(ident, ["u8", "u16", "u32", "u64"]) {
} else if ident_in_list(ident, ["u8", "u16", "u32", "u64", "u128"]) {
primitive = Some((meta.path.clone(), false));
} else if ident_in_list(ident, ["i8", "i16", "i32", "i64"]) {
} else if ident_in_list(ident, ["i8", "i16", "i32", "i64", "i128"]) {
primitive = Some((meta.path.clone(), true));
} else if ident_in_list(ident, ["usize", "isize", "u128", "i128"]) {
} else if ident_in_list(ident, ["usize", "isize"]) {
return Err(ident
.span()
.error(format!("`repr({ident})` types are not supported"))
Expand Down
2 changes: 2 additions & 0 deletions rust/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -716,10 +716,12 @@ abstract_type! {
u16 => Type::int(2, false),
u32 => Type::int(4, false),
u64 => Type::int(8, false),
u128 => Type::int(16, false),
i8 => Type::int(1, true),
i16 => Type::int(2, true),
i32 => Type::int(4, true),
i64 => Type::int(8, true),
i128 => Type::int(16, true),
f32 => Type::float(4),
f64 => Type::float(8)
}
Expand Down

0 comments on commit 27bd9aa

Please sign in to comment.