Android PR integration

This commit is contained in:
van Hauser
2019-11-11 23:50:31 +01:00
parent 613ab3ba2a
commit 760d4991f3
11 changed files with 33 additions and 26 deletions

View File

@ -73,7 +73,7 @@ void read_bitmap(u8* fname) {
u8 has_new_bits(u8* virgin_map) {
#ifdef __x86_64__
#ifdef WORD_SIZE_64
u64* current = (u64*)trace_bits;
u64* virgin = (u64*)virgin_map;
@ -87,7 +87,7 @@ u8 has_new_bits(u8* virgin_map) {
u32 i = (MAP_SIZE >> 2);
#endif /* ^__x86_64__ */
#endif /* ^WORD_SIZE_64 */
u8 ret = 0;
@ -107,7 +107,7 @@ u8 has_new_bits(u8* virgin_map) {
/* Looks like we have not found any new bytes yet; see if any non-zero
bytes in current[] are pristine in virgin[]. */
#ifdef __x86_64__
#ifdef WORD_SIZE_64
if ((cur[0] && vir[0] == 0xff) || (cur[1] && vir[1] == 0xff) ||
(cur[2] && vir[2] == 0xff) || (cur[3] && vir[3] == 0xff) ||
@ -125,7 +125,7 @@ u8 has_new_bits(u8* virgin_map) {
else
ret = 1;
#endif /* ^__x86_64__ */
#endif /* ^WORD_SIZE_64 */
}
@ -244,7 +244,7 @@ const u8 simplify_lookup[256] = {
};
#ifdef __x86_64__
#ifdef WORD_SIZE_64
void simplify_trace(u64* mem) {
@ -306,7 +306,7 @@ void simplify_trace(u32* mem) {
}
#endif /* ^__x86_64__ */
#endif /* ^WORD_SIZE_64 */
/* Destructively classify execution counts in a trace. This is used as a
preprocessing step for any newly acquired traces. Called on every exec,
@ -339,7 +339,7 @@ void init_count_class16(void) {
}
#ifdef __x86_64__
#ifdef WORD_SIZE_64
void classify_counts(u64* mem) {
@ -391,7 +391,7 @@ void classify_counts(u32* mem) {
}
#endif /* ^__x86_64__ */
#endif /* ^WORD_SIZE_64 */
/* Compact trace bytes into a smaller bitmap. We effectively just drop the
count information here. This is called only sporadically, for some
@ -595,11 +595,11 @@ u8 save_if_interesting(char** argv, void* mem, u32 len, u8 fault) {
if (!dumb_mode) {
#ifdef __x86_64__
#ifdef WORD_SIZE_64
simplify_trace((u64*)trace_bits);
#else
simplify_trace((u32*)trace_bits);
#endif /* ^__x86_64__ */
#endif /* ^WORD_SIZE_64 */
if (!has_new_bits(virgin_tmout)) return keeping;
@ -658,11 +658,11 @@ u8 save_if_interesting(char** argv, void* mem, u32 len, u8 fault) {
if (!dumb_mode) {
#ifdef __x86_64__
#ifdef WORD_SIZE_64
simplify_trace((u64*)trace_bits);
#else
simplify_trace((u32*)trace_bits);
#endif /* ^__x86_64__ */
#endif /* ^WORD_SIZE_64 */
if (!has_new_bits(virgin_crash)) return keeping;