[PATCH] Change the way labels are propagated when comparing memory through libc functions

Peter Collingbourne peter at pcc.me.uk
Mon Dec 2 12:04:42 PST 2013


  I think you've convinced me that we should disregard control dependencies by default. I'm not so sure about introducing a new option for this, but I think it's probably ok until we can make a more informed decision.

  Please split the new custom functions into a separate patch.


================
Comment at: lib/dfsan/dfsan_custom.cc:131
@@ +130,3 @@
+
+  return NULL;
+}
----------------
You need to set the return label here.

================
Comment at: lib/dfsan/dfsan_custom.cc:144
@@ +143,3 @@
+
+  while (moving_haystack_len > needle_len) {
+    if (internal_memcmp(moving_haystack, needle, needle_len) == 0) {
----------------
What if needle is the same length as haystack?

In general I would prefer to wrap functions such as strstr where the behavior is non-trivial.


http://llvm-reviews.chandlerc.com/D2252



More information about the llvm-commits mailing list