<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/61962>61962</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[MLIR] No assert on out of range `op->getResult(i)`
</td>
</tr>
<tr>
<th>Labels</th>
<td>
mlir:core
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
lattner
</td>
</tr>
</table>
<pre>
I recently called `op->getResult(0)` on a function like operation with no results, and MLIR returned a garbage pointer that took me a few hops to figure out. It would have been nicer if `Operation::getOpResultImpl` asserted the the number was in-range.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxskc9u3CAQxp8GX0ZrYbzrPwcftk1XWqltpLwB4LFNgxkLhqzy9pWdVL3kgBCHGb7f99MpuTkgDuLyTVyeCp15oTh4zRwwFobG9-EOES0G9u9gtfc4gmgkbSdR_5iRXzBlz0J1UqheNBIogIYpB8uOAnj3ikAbRn08H44XCATxmEpCfQcdRvj18_4CETnHgCNomHU0ekbYyAXGCLxoBiZ6hRX37fiAhbYETDC5OUcEylwC3BkelP0Ii35DMIgBgrMYwU176Od_OUR9FfV1Rn7ePvLf183v4XVKGBlH4AWPE_JqMMJDJ3DhFHWYsSzGoR77utcFDlXTyVb1Va-KZZCVrM1k2s5g23XYt8aqStka9XS-tNIWblBS1fIsL6qq6kqV2lZdM0nT9G137utRnCWu2vnS-7e1pDgXLqWMQ1P1jSq8NujT4Uqp1bso6quliEKpXV4c9qmTyXMSZ-ld4vR_Dzv2h-a9a3F5gt_0Sbsbo8xAExx8X-t1H3qLHP2wMG9p71DdhLrNjpdsSkurULf9v8_rtEX6g5aFuh0QSajbwfE3AAD__1ptzTE">