[Mesa-dev] [PATCH 1/2] glsl hierarchical visitor: Do not overwrite base_ir for parameter lists.

Kenneth Graunke kenneth at whitecape.org
Mon Sep 19 11:18:10 PDT 2011


On 09/15/2011 04:40 PM, Paul Berry wrote:
> This patch fixes a bug in ir_hirearchical_visitor: when traversing an
> exec_list representing the formal or actual parameters of a function,
> it modified base_ir to point to each parameter in turn, rather than
> leaving it as a pointer to the enclosing statement.  This was a
> problem, since base_ir is used by visitor classes to locate the
> statement containing the node being visited (usually so that
> additional statements can be inserted before or after it).  Without
> this fix, visitors might attempt to insert statements into parameter
> lists.
> ---
>   src/glsl/ir_hierarchical_visitor.h |    3 ++-
>   src/glsl/ir_hv_accept.cpp          |   21 +++++++++++++++------
>   2 files changed, 17 insertions(+), 7 deletions(-)

I'm still not happy about ir_function and ir_function_signature being 
statements, but this definitely seems necessary for ir_call.  I think 
this is the minimal patch necessary to get things working for the time 
being; there may be a cleaner way but it'd be a lot of work.

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>


More information about the mesa-dev mailing list