[PATCH] D35032: [sanitizer] Use TASK_VM_INFO to get the maximum VM address on iOS/AArch64
Filipe Cabecinhas via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 6 05:17:24 PDT 2017
filcab 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;
----------------
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.
================
Comment at: lib/sanitizer_common/sanitizer_mac.cc:824
+ static uptr max_vm = 0;
+ if (max_vm == 0) max_vm = GetTaskInfoMaxAddress();
+ CHECK(max_vm);
----------------
Why not `static uptr max_vm = GetTaskInfoMaxAddress();`?
Repository:
rL LLVM
https://reviews.llvm.org/D35032
More information about the llvm-commits
mailing list