[PATCH] D83494: [libFuzzer] Link libFuzzer's own interceptors when other compiler runtimes are not linked.

Matt Morehouse via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 16 09:52:07 PDT 2020


morehouse added inline comments.


================
Comment at: compiler-rt/lib/fuzzer/FuzzerInterceptors.cpp:53
+int fuzzer_inited = 0;
+bool fuzzer_init_is_running;
+
----------------
These are in the global namespace, and have C mangling, which is unnecessary.  Please either put them in a namespace or make them static.


================
Comment at: compiler-rt/lib/fuzzer/FuzzerInterceptors.cpp:55
+
+static void __fuzzer_init();
+
----------------
This also doesn't need C mangling.


================
Comment at: compiler-rt/lib/fuzzer/FuzzerInterceptors.cpp:63
+    }                                                                          \
+  } while (0)
+
----------------
Let's prefer a function rather than a macro for this.


================
Comment at: compiler-rt/lib/fuzzer/FuzzerInterceptors.cpp:143
+    return;
+  fuzzer_init_is_running = 1;
+
----------------
Let's use true/false rather than 1/0 for bools.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D83494/new/

https://reviews.llvm.org/D83494





More information about the cfe-commits mailing list