[Mesa-dev] [Bug 101766] Assertion `!"invalid type"' failed when constant expression involves literal of different type

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Tue Aug 15 17:44:54 UTC 2017


https://bugs.freedesktop.org/show_bug.cgi?id=101766

--- Comment #3 from Ilia Mirkin <imirkin at alum.mit.edu> ---
Happened to do a bit more looking.

So for the expression

const float x = 1;

the 1 is processed, and since it's part of a const assignment, it tries to
assign it to x. That fails (types don't match), and so it sets state->error =
true, and then ...

      } else {
         if (var->type->is_numeric()) {
            /* Reduce cascading errors. */
            var->constant_value = type->qualifier.flags.q.constant
               ? ir_constant::zero(state, var->type) : NULL;
         }
      }

where var->type is float (var == "x"). However rhs remains as the "1", and
things in the variable are initialized based on that. This causes an
inconsistency which triggers the impossible case below. I believe I have a
one-line fix.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170815/99731fba/attachment.html>


More information about the mesa-dev mailing list