make eqv happy :)

This commit is contained in:
Andrea Fioraldi 2020-12-16 14:11:39 +01:00
parent 617539425d
commit 4cccdf1378
3 changed files with 6 additions and 0 deletions

View File

@ -39,3 +39,4 @@ xxhash-rust = { version = "0.8.0", features = ["xxh3"] } # xxh3 hashing for rust
serde = { version = "1.0", default-features = false, features = ["alloc"] } # serialization lib
erased-serde = "0.3.12"
postcard = { version = "0.5.1", features = ["alloc"] } # no_std compatible serde serialization fromat
static_assertions = "1.1.0"

View File

@ -7,6 +7,9 @@ Welcome to libAFL
#[macro_use]
extern crate alloc;
#[macro_use]
extern crate static_assertions;
pub mod corpus;
pub mod engines;
pub mod events;

View File

@ -7,10 +7,12 @@ use core::any::{Any, TypeId};
// yolo
pub fn pack_type_id(id: u64) -> TypeId {
assert_eq_size!(TypeId, u64);
unsafe { *(&id as *const u64 as *const TypeId) }
}
pub fn unpack_type_id(id: TypeId) -> u64 {
assert_eq_size!(TypeId, u64);
unsafe { *(&id as *const _ as *const u64) }
}