<html>
<head>
<base href="https://bugs.freedesktop.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_ASSIGNED "
title="ASSIGNED - Mesa's compiler should warn about undefined values"
href="https://bugs.freedesktop.org/show_bug.cgi?id=94129#c7">Comment # 7</a>
on <a class="bz_bug_link
bz_status_ASSIGNED "
title="ASSIGNED - Mesa's compiler should warn about undefined values"
href="https://bugs.freedesktop.org/show_bug.cgi?id=94129">bug 94129</a>
from <span class="vcard"><a class="email" href="mailto:apinheiro@igalia.com" title="Alejandro Piņeiro (freenode IRC: apinheiro) <apinheiro@igalia.com>"> <span class="fn">Alejandro Piņeiro (freenode IRC: apinheiro)</span></a>
</span></b>
<pre>After some extra code checking on both AST and IR.
(In reply to Timothy Arceri from <a href="show_bug.cgi?id=94129#c4">comment #4</a>)
<span class="quote">> The AST is a bit awkward to work with beyond basic validation. You would
> likely find it easier to add this in GLSL IR somewhere.</span >
There is another reason to try to do this on the ast_to_hir pass. As in the NIR
case, at GLSL IR we don't have available the source location. This is needed if
we want to add additional information, for example, in which source line:column
number the uninitialized value is being used. All the error/warnings raised at
GLSL IR (not a lot) doesn't provide that info, and need to provide a fake
location. For example:
memset(&loc, 0, sizeof(loc));
_mesa_glsl_error(&loc, state,
"function `%s' has static recursion",
proto);
I guess that for this case, a message "var %s used initialized" is better that
nothing, but I think that is more useful if it points to the line:column number
as other warnings/errors (like undeclared variable).
(And sorry for the previous not finished comment, pressed the wrong key)</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>