mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-04-27 20:57:59 +00:00
allow register sized int type for memory offsets
Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
This commit is contained in:
@@ -1182,6 +1182,15 @@ where
|
||||
&self,
|
||||
value: inkwell::values::IntValue<'ctx>,
|
||||
) -> anyhow::Result<inkwell::values::IntValue<'ctx>> {
|
||||
if value.get_type() == self.xlen_type() {
|
||||
return Ok(value);
|
||||
}
|
||||
assert_eq!(
|
||||
value.get_type(),
|
||||
self.word_type(),
|
||||
"expected XLEN or WORD sized int type for memory offset",
|
||||
);
|
||||
|
||||
let truncated = self.builder().build_int_truncate_or_bit_cast(
|
||||
value,
|
||||
self.xlen_type(),
|
||||
|
||||
Reference in New Issue
Block a user