[PATCH] D28502: [compiler-rt] [Interception] Properly check for export table's size before referring to its elements.

Zachary Turner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 9 16:56:44 PST 2017


zturner accepted this revision.
zturner added inline comments.


================
Comment at: lib/interception/interception_win.cc:881
       &headers->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT];
+  if (!(export_directory->Size))
+    return 0;
----------------
rnk wrote:
> It's probably more readable to do `== 0` since Size is a number, not a pointer.
The parentheses aren't necessary, and can you compare it explicitly to `0` instead of using an implicit bool conversion?

Otherwise, lgtm.


Repository:
  rL LLVM

https://reviews.llvm.org/D28502





More information about the llvm-commits mailing list