<html>
    <head>
      <base href="https://bugs.freedesktop.org/">
    </head>
    <body><span class="vcard"><a class="email" href="mailto:t_arceri@yahoo.com.au" title="Timothy Arceri <t_arceri@yahoo.com.au>"> <span class="fn">Timothy Arceri</span></a>
</span> changed
          <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - shader crashing glsl_compiler (uniform block assigned to vec2, then component substraced by 1)"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=107547">bug 107547</a>
          <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">Resolution</td>
           <td>---
           </td>
           <td>FIXED
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">Status</td>
           <td>NEW
           </td>
           <td>RESOLVED
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - shader crashing glsl_compiler (uniform block assigned to vec2, then component substraced by 1)"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=107547#c5">Comment # 5</a>
              on <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - shader crashing glsl_compiler (uniform block assigned to vec2, then component substraced by 1)"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=107547">bug 107547</a>
              from <span class="vcard"><a class="email" href="mailto:t_arceri@yahoo.com.au" title="Timothy Arceri <t_arceri@yahoo.com.au>"> <span class="fn">Timothy Arceri</span></a>
</span></b>
        <pre>Should be fixed by:

commit 6f3c7374b11299c21d829db794fad3b756af60fb
Author: Danylo Piliaiev <<a href="mailto:danylo.piliaiev@gmail.com">danylo.piliaiev@gmail.com</a>>
Date:   Wed Aug 15 15:46:22 2018 +0300

Date:   Wed Aug 15 15:46:22 2018 +0300

    glsl: Avoid propagating incompatible type of initializer

    do_assignment validated assigment but when rhs type was not compatible
    it proceeded without issues and returned error_emitted = false.
    On the other hand process_initializer expected do_assignment to always
    return compatible type and never fail.

    As a result when variable was initialized with incompatible type
    the type of variable changed to the incompatible one.
    This manifested in unnecessary error messages and in one case in crash.

    Example GLSL:
     vec4 tmp = vec2(0.0);
     tmp.z -= 1.0;

    Past error messages:
     initializer of type vec2 cannot be assigned to variable of type vec4
     invalid swizzle / mask `z'
     type mismatch
     operands to arithmetic operators must be numeric

    After this patch:
     initializer of type vec2 cannot be assigned to variable of type vec4

    In the other case when we initialize variable with incompatible struct,
    accessing variable's field leaded to a crash. Example:
     uniform struct {float field;} data;
     ...
     vec4 tmp = data;
     tmp.x -= 1.0;

    After the patch there is only error line without a crash:
     initializer of type #anon_struct cannot be assigned to variable of
      type vec4

    Signed-off-by: Danylo Piliaiev <<a href="mailto:danylo.piliaiev@globallogic.com">danylo.piliaiev@globallogic.com</a>>
    Reviewed-by: Timothy Arceri <<a href="mailto:tarceri@itsqueeze.com">tarceri@itsqueeze.com</a>>
    Bugzilla: <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - shader crashing glsl_compiler (uniform block assigned to vec2, then component substraced by 1)"
   href="show_bug.cgi?id=107547">https://bugs.freedesktop.org/show_bug.cgi?id=107547</a></pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>