silver icon indicating copy to clipboard operation
silver copied to clipboard

Flow edges for tree sharing sites miss inherited attributes not in the env

Open krame505 opened this issue 2 years ago • 0 comments

I just found a significant bug in the flow analysis for decoration via references, e.g. if one were to write

production foo
top::Expr ::= e::Expr
{
  forwards to bar(@e);
}

and another grammar adds a new inherited attribute i on Expr, we wouldn't generate an edge for e.i depending on the vertex for i on the subterm vertex corresponding to the first argument of bar in the forward equation. This means that one could use e.i in an aspect for foo, and we could miss some flow errors like if bar didn't supplies an equation for i on its child.

The fix for this is to add these edges later, in constructProductionGraph, when we have the environment with all inherited attribute occurrences.

krame505 avatar Oct 04 '23 00:10 krame505