<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/131078>131078</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Function `clang_Type_getObjCEncoding` causes segmentation fault if called with `Invalid` type
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
YSakhno
</td>
</tr>
</table>
<pre>
If the libclang function `clang_Type_getObjCEncoding()` is called with an invalid type (that is type whose kind is `CXType_Invalid`), it fails with a segmentation fault.
**Expected behavior**
The function should not fail for any input that can be legitimately obtained from other libclang functions. If the type is 'unsupported', an empty string can be returned (for example).
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyMUj1v3DAM_TXyQuQg0z5_DB7SNAdk6tAM7RRIFm0rkSXDoi65f1_Yd0VQtEMBAoIo8vE96qkY7eiJOnH8Io5fM5V4Cmv387t6m3zIdDCX7mkAngic1b1TfoQh-Z5t8CAquWdeni8LvYzE3_Trw6Pvg7F-FNgIbEUlwUbolXNk4N3yBMqD9WflrAG-LAQCG54Ub2X7_X0KkeDNerOlRCUffuz4T9cmUckNFx_AMgzKuniDhUjjTJ7Vzm1QyfFByPstcIvHj4V6JgOaJnW2Yb2mryXPE33qilNIzoAP1wEwhBWUv4D1S2LYyfbKgyZwNFq2s2JyFwialfVkYFjDDIEnWv9eWjzAbZ-72E0h1snHtCxhZTIC602b8kDzwheIvFo__p63Eqd1GyGw2VjRh5oXRwLbQ2a6wrRFqzLq8rrMm7IuqjybusHQUeJQN1V5bHWhj7Icmr43baW1loPObIcSj7LIC1lhi_lBY41DKU2tjKG6RFFKmpV1B-fO8yGsY2ZjTNTlRS7rJnNKk4u7gxA9vcP-KhA3Q63d1nSn0xhFKZ2NHD9h2LKj7vR_fqok9CpFiv_4aLDDHx4Tlfy0y77pLK2um5iXKIp7gSeBp9HylPShD7PA08bpdtwta3ilngWediVR4Okm9dzhrwAAAP__3ZUR_Q">