../

Zigright

2026-05-05

How to construct the CFG?

const CFGNode = struct {
    nodes_in: []*CFGNode,
    nodes_out: []*CFGNode,
    type: enum {
        Normal,
        // One per function
        Return,
        // One per function
        Start,
    },
    // The token is the "canonical" token for a given variable -- the declaration, for example.
    // If a token doesn't have an entry, it is implicitly Uninit.
    sources_out: std.AutoHashMap(std.zig.Ast.TokenIndex, Set(SourceState)),
    sinks_out: std.AutoHashMap(std.zig.Ast.TokenIndex, Set(SinkState)),
    ast_nodes: []std.zig.Ast.Node.Index,
};
const std = @import("std");

2026-05-04

  • How to check the rules
  • Basic rule checking
    • To check for errors go through each function that takes in an allocator
    • Annotate each variable within that function with source and sink

2026-04-23

  • Define rules

    • Example would be similar to what we saw in class
  • How to do data flow analysis in general

  • Start with simple rules

  • Just annotate functions based on if they allocate or not allocate

  • main is an allocator by default as it takes in init

  • Take a filename as an arg and print it back to the screen

  • If no filename is given then read in stdin

2026-04-14 Meeting

  • dict with between every line of code: like cin, cout we saw in class
    • key is locally scoped var and value is a struct { creator:set , destructor: set}
    • var obj = undefined
      if(x){
          obj = alloc1
      }else{
          obj = alloc2
      }
      
    • We need sets to describe this. Runtime selection of allocators