[PATCH] D44672: [CodeGen] Disable UBSan for coroutine functions

Vedant Kumar via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 20 11:26:57 PDT 2018


vsk added a comment.

The "Cannot represent a difference across sections" error is almost certainly related to -fsanitize=function. Time permitting, could you file a separate PR for that and attach the IR? It'd be great to know whether the issue reproduces without coroutines involved.

Also, could you check in a simple test (something along the lines of what you posted to llvm-dev)? You can just pass '-emit-llvm -fcoroutines -fsanitize=null' and check that the string '__ubsan' doesn't appear.



================
Comment at: lib/CodeGen/CodeGenFunction.cpp:1307
+  if (Body && Body->getStmtClass() == Stmt::CoroutineBodyStmtClass)
+    SanOpts.clear();
+
----------------
The suppression should live right next to the logic which handles no_sanitize attributes, in CGF::StartFunction. In general you can end up in CGF::StartFunction without the immediate caller being CGF::GenerateCode.


Repository:
  rC Clang

https://reviews.llvm.org/D44672





More information about the cfe-commits mailing list