Skip to content

Commit

Permalink
test/util: explicitly unsupport non-4/8 bytes pointers
Browse files Browse the repository at this point in the history
  • Loading branch information
shintaro-iwasaki committed Mar 25, 2021
1 parent 7197a07 commit 2db1501
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/util/abttest.c
Original file line number Diff line number Diff line change
Expand Up @@ -341,14 +341,15 @@ static inline size_t ABT_tool_unit_entry_table_index(const void *unit)
uint32_t val2 = val ^ (val >> 16);
return (val2 ^ (val2 >> 8)) &
(ATS_TOOL_UNIT_ENTRY_TABLE_NUM_ENTIRES - 1);
} else if (sizeof(void *) == 8) {
} else {
/* We support only 32-bit or 64-bit pointer sizes. */
assert(sizeof(void *) == 8);
uint64_t val = (uint64_t)(uintptr_t)unit;
uint64_t val2 = val ^ (val >> 32);
uint64_t val3 = val2 ^ (val2 >> 16);
return (val3 ^ (val3 >> 8)) &
(ATS_TOOL_UNIT_ENTRY_TABLE_NUM_ENTIRES - 1);
}
return 0;
}

static ATS_tool_unit_entry *ATS_tool_get_unit_entry(const void *unit)
Expand Down

0 comments on commit 2db1501

Please sign in to comment.