<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">In these days I’ve integrated llc code into my compiler.<div class=""><br class=""></div><div class="">I had an undefined behaviour because when <font face="Menlo" style="font-size: 11px;" class="">cl::AddExtraVersionPrinter(TargetRegistry::printRegisteredTargetsForVersion) </font>is called, the modules I give to the code in input to compile got somehow “corrupted" by this function.</div><div class="">It is definitely an undefined behaviour because every debug I do, modules gets different changes, producing different assertions every run:</div><div class=""><br class=""></div><div class="">- Target triple string gets changes with null characters (“\0\0\0\0\0\0\0\0\0\0\0”), or other values that have nothing to do with an llvm triple</div><div class="">- Head of the function list contained in the module becomes NULL (I said functions but maybe other components may be nullified as well)</div><div class=""><br class=""></div><div class="">I tried to see where the modules change, and I figured out that 6/10 times the target triple is ok before that instruction, then it takes weird changes after it.</div><div class="">The problem is that function because when I removed it, everything worked fine.</div><div class=""><br class=""></div><div class="">I didn't figure out how that function may change modules that way, so I just report this bug here.</div></body></html>