implement transmute intrinsic

This commit is contained in:
hkalbasi 2023-03-14 12:49:09 +03:30
parent 7525a38af5
commit 513e340bd3

View File

@ -1187,7 +1187,7 @@ impl Evaluator<'_> {
fn exec_intrinsic( fn exec_intrinsic(
&self, &self,
as_str: &str, as_str: &str,
_arg_bytes: impl Iterator<Item = Vec<u8>>, mut arg_bytes: impl Iterator<Item = Vec<u8>>,
generic_args: Substitution, generic_args: Substitution,
locals: &Locals<'_>, locals: &Locals<'_>,
) -> Result<Vec<u8>> { ) -> Result<Vec<u8>> {
@ -1202,6 +1202,12 @@ impl Evaluator<'_> {
None => return Err(MirEvalError::TypeError("size_of arg is unsized")), None => return Err(MirEvalError::TypeError("size_of arg is unsized")),
} }
} }
"transmute" => {
let Some(arg) = arg_bytes.next() else {
return Err(MirEvalError::TypeError("trasmute arg is not provided"));
};
Ok(arg)
}
_ => not_supported!("unknown intrinsic {as_str}"), _ => not_supported!("unknown intrinsic {as_str}"),
} }
} }