trailofbits / binary_type_inference

GNU General Public License v3.0
11 stars 0 forks source link

Allow sharing type structure within global variables. #32

Open 2over12 opened 2 years ago

2over12 commented 2 years ago

Currently global type inference works in the following way:

After binding polymorphic types we visit all sketchgraphs looking for global variables referenced in sccs.

For each variable we collect the intersection of the global variable subsketch each time it appears. This has the effect of concretizing the global type into one unified sketch. These unified sketches are then placed back into the scc sketches so that parameter aliasing can use this updated information.

Later we create a graph for each global in the global type graph (bad name... it's the type graph of all sccs). Each node that used to point to the global gets pointed to this new subgraph. This strategy doesnt allow for sharing structure between globals that share a structure type. To do this we need to alias uses of a global in a parent global to the child globals representation.