[JITLink] Add eh-frame CFI inspector, fix crash on malformed FDEs.
Add a fix to check that FDE pc-begin targets are defined before calling getBlock (which will crash if the target is not defined). FDE pc-begins pointing at undefined symbols are expected to arise only in obscure circumstances (malformed objects, or removal of targets by JITLink passes), but we want to handle them gracefully. With this patch the FDE will be retained, but without any keepalive edge to it. Unless some pass takes action to mark it as live it will be dead-stripped. To make it easier for passes to connect FDEs to their targets a new EHFrameCFIBlockInspector utility is added. This allows clients to quickly determine whether a CFI record is a CIE or an FDE (assuming that it's valid), and retrieve any personality, pc-begin, cie, or LSDA edges associated with it.
Loading
Please sign in to comment