<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Oct 15, 2014 at 2:44 PM, Dingbao Xie <span dir="ltr"><<a href="mailto:xiedingbao@gmail.com" target="_blank">xiedingbao@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div>Dear list,<br></div>I know that unsan can detect certain number of undefined behaviors at runtime.<br></div>When compiling the program with option -fsanitize=undefined, some checking code <br>will be inserted into the necessary position. I looked at the source code of ubsan,<br></div></div></blockquote><div><br></div><div>I assume you mean the ubsan runtime in compiler_rt?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>but failed to find the code that performs the instrumentation. <br></div><div>I'm trying to understand how ubsan works by looking at its source code.<br></div><div>Does anybody know where is the corresponding source code located?</div></div></blockquote><div><br></div><div>The code that inserts the instrumentation is spread throughout Clang's lib/CodeGen. Search for calls to EmitCheck. </div></div></div></div>