<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Segfault on void-typed last sequence element"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=76198">76198</a>
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>idr@freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Segfault on void-typed last sequence element
          </td>
        </tr>

        <tr>
          <th>QA Contact</th>
          <td>intel-3d-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>anthony@adsorbtion.org
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>git
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>glsl-compiler
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>Mesa
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=95847" name="attach_95847" title="0001-glsl-Fix-segfault-on-void-rightmost-sequence-express.patch">attachment 95847</a> <a href="attachment.cgi?id=95847&action=edit" title="0001-glsl-Fix-segfault-on-void-rightmost-sequence-express.patch">[details]</a></span>
0001-glsl-Fix-segfault-on-void-rightmost-sequence-express.patch

I have some autogenerated geometry shader with sequence like 
((dbgIter0 == 0 && (dbgResult = float(1.0), true)), EmitVertex())
It is wrong code generation on my side, but I found that glsl-compiler
segfaults on this line.
Problem in ast_to_hir.cpp (:1737 for current git) in ast_sequence expression
type processing. Result of last operand is NULL due to void return type of
EmitVertex.
>From the GLSL spec (p.107 of pdf of 4.40) sequence must return type and value
of rightmost expression, so void-typed expressions must emit some error. I've
attached patch with fix. I'm not sure about the way I chose, maybe compiler
must do something different in that case.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the QA Contact for the bug.</li>
      </ul>
    </body>
</html>