Merge pull request #1685 from relapids/fix_sample_ctl_tb_cache

Fix for test_uc_ctl_tb_cache. (#1683)
This commit is contained in:
lazymio 2022-08-15 20:33:28 +02:00 committed by GitHub
commit 336425b588
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -243,7 +243,7 @@ static void test_uc_ctl_tb_cache()
// Now we request cache for all TBs.
for (int i = 0; i < TB_COUNT; i++) {
err = uc_ctl_request_cache(uc, ADDRESS + i * TCG_MAX_INSNS, &tb);
err = uc_ctl_request_cache(uc, (uint64_t)(ADDRESS + i * TCG_MAX_INSNS), &tb);
printf(">>> TB is cached at 0x%" PRIx64 " which has %" PRIu16
" instructions with %" PRIu16 " bytes.\n",
tb.pc, tb.icount, tb.size);
@ -258,8 +258,8 @@ static void test_uc_ctl_tb_cache()
// Now we clear cache for all TBs.
for (int i = 0; i < TB_COUNT; i++) {
err = uc_ctl_remove_cache(uc, ADDRESS + i * TCG_MAX_INSNS,
ADDRESS + i * TCG_MAX_INSNS + 1);
err = uc_ctl_remove_cache(uc, (uint64_t)(ADDRESS + i * TCG_MAX_INSNS),
(uint64_t)(ADDRESS + i * TCG_MAX_INSNS + 1));
if (err) {
printf("Failed on uc_ctl() with error returned: %u\n", err);
return;