nested-heap-write.ts 684 B

1234567891011
  1. // Nested-target heap write (fix #4): an ask result assigned into a deeply nested
  2. // object field (`report.sections.intro = r`). The assignment target's receiver
  3. // `report.sections` is itself a member access, so there is no single field slot to
  4. // update field-sensitively; the write falls back to weak-merging the ask taint into
  5. // the leftmost identifier `report`. `report` reaches the return, so ask#1 must
  6. // keep a data edge to the sink (a may-flow analysis must not drop the flow).
  7. // Expected: source -> ask#1, ask#1 -> sink.
  8. const report = { sections: { intro: "" } };
  9. const r = await agent("writer").ask<string>("write the intro");
  10. report.sections.intro = r;
  11. return report;