mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-06-14 12:11:02 +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,
|
&self,
|
||||||
value: inkwell::values::IntValue<'ctx>,
|
value: inkwell::values::IntValue<'ctx>,
|
||||||
) -> anyhow::Result<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(
|
let truncated = self.builder().build_int_truncate_or_bit_cast(
|
||||||
value,
|
value,
|
||||||
self.xlen_type(),
|
self.xlen_type(),
|
||||||
|
|||||||
Reference in New Issue
Block a user