[PATCH] D35032: [sanitizer] Use TASK_VM_INFO to get the maximum VM address on iOS/AArch64

Kuba (Brecka) Mracek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 6 11:42:37 PDT 2017


kubamracek marked 3 inline comments as done.
kubamracek added inline comments.


================
Comment at: lib/sanitizer_common/sanitizer_mac.cc:808
+uptr GetTaskInfoMaxAddress() {
+  integer_t vm_info[kTaskVmInfoCount] = {0};
+  mach_msg_type_number_t count = kTaskVmInfoCount;
----------------
filcab wrote:
> Shouldn't this be a `task_vm_info_data_t`? Or is that not available?
> As far as I can tell, `integer_t` are `int`, and we're not guaranteed to have this array properly aligned for that `uptr` load.
> 
> If it's not available, I'm ok with a stub somewhere, but I'd make this either a properly-sized and aligned struct, or a `uptr` array (proper alignment, AFAICT) and cast its pointer when calling task_info.
`task_vm_info_data_t` can't be used because we need to access a field that's only available in a new version of the SDK, and we still want to be able to build with the older SDKs.

You're right about the int/integer_t/uptr confusion.  The new version should be more clear.


https://reviews.llvm.org/D35032





More information about the llvm-commits mailing list