bytecodealliance / wac

WebAssembly Composition (WAC) tooling
Apache License 2.0
109 stars 15 forks source link

`wac-graph`: defined types need dependency edges to other defined types #78

Closed peterhuene closed 6 months ago

peterhuene commented 6 months ago

Currently CompositionGraph::define_type allows for exporting a named type from the composition.

However, the node it creates in the graph has no dependency edges on other defined types that might be referenced from the type definition.

The result is that the toposort performed when the graph is encoded does not properly order the types such that they are in correct topological order (although the ordering is a stable one).

The fix is to add a "depends on" edge from the node to any defined type referenced from the type being defined.

peterhuene commented 6 months ago

I have a fix for this with the upcoming wac-parser resolution rewrite.