<html>
<head>
<base href="https://bugs.freedesktop.org/">
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - Assertion `!"invalid type"' failed when constant expression involves literal of different type"
href="https://bugs.freedesktop.org/show_bug.cgi?id=101766#c3">Comment # 3</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - Assertion `!"invalid type"' failed when constant expression involves literal of different type"
href="https://bugs.freedesktop.org/show_bug.cgi?id=101766">bug 101766</a>
from <span class="vcard"><a class="email" href="mailto:imirkin@alum.mit.edu" title="Ilia Mirkin <imirkin@alum.mit.edu>"> <span class="fn">Ilia Mirkin</span></a>
</span></b>
<pre>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.</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>