<div dir="ltr"><div>The function verifyFunction() in lib/IR/Verifier.cpp misses some calls. It creates a temporary FunctionPassManager that will run a single Verifier pass. Unfortunately, FunctionPassManager is no PassManager and does not call doInitialization() and doFinalization() by itself. Verifier does important tasks in doInitialization() such as collecting type information used to check DebugInfo metadata and doFinalization() does some additional checks. Therefore these checks were missed and debug info couldn't be verified at all, it just crashed if the function had some.<br>


<br></div>verifyFunction() is currently not used in llvm unless -debug option is enabled, and in unittests/IR/VerifierTest.cpp<br><div><div><div><br></div><div>VerifierTest had to be changed to create the function in a module from which the type debug info can be collected.<br>

</div><div><br></div><div>Patch applicable to r193391.<br>
</div><div><br></div><div>Regards,<br></div><div>Michael Kruse<br><br></div></div></div></div>