<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi Philip<div class=""><br class=""></div><div class="">While reducing a test case with personality functions, I crashed selection DAG.  The reason being that my personality function was no longer a function.  The relevant code is</div><div class=""><br class=""></div><div class="">  MF->getMMI().addPersonality(MBB, cast<Function>(LPadInst->getParent()<br class="">                                                      ->getParent()<br class="">                                                      ->getPersonalityFn()<br class="">                                                      ->stripPointerCasts()));</div><div class=""><br class=""></div><div class="">We get different behavior in this code, which is able to handle non-function personality functions.</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">EHPersonality</span> <span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">llvm</span>::classifyEHPersonality(<span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">const</span> <span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">Value</span> *Pers) {</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(49, 89, 93);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">  </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">const</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">Function</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> *F = </span>dyn_cast<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""><</span><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">Function</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">>(Pers-></span>stripPointerCasts<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">());</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">  <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">if</span> (!F)</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">    </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">return</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span>EHPersonality<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">::</span><span style="font-variant-ligatures: no-common-ligatures; color: #31595d" class="">Unknown</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">;</span></div></div><div class=""><br class=""></div><div class="">And finally, LangRef itself implies that its a function as it says that we should 'specify what function to use for exception handling’.</div><div class=""><br class=""></div><div class="">So i’m not sure exactly what behavior we want.</div><div class=""><br class=""></div><div class="">However, assuming we do want personality functions to always actually be functions (which was what i originally thought we wanted), here’s a patch which teaches the verifier this.</div><div class=""><br class=""></div><div class="">Comments welcome, including the possibility that this is completely wrong and that we do want to support other values as personalities.</div><div class=""><br class=""></div><div class="">Cheers</div><div class="">Pete</div><div class=""><br class=""></div><div class=""></div></body></html>