Fix casting error

virt should be cast to a uintptr_t before it is cast to uint64_t