Closed paldepind closed 5 days ago
Currently self parameters are not included in the CFG. This PR adds them.
self
This example:
fn add(&mut self, a: i64, b: i64) { self.n += a + b; }
results in this CFG (previously the 2nd and 3rd node where not there):
flowchart TD 1["enter add"] 10["BlockExpr"] 11["self"] 12["FieldExpr"] 13["... += ..."] 14["ExprStmt"] 15["a"] 16["... + ..."] 17["b"] 2["exit add"] 3["exit add (normal)"] 4["SelfParam"] 5["self"] 6["a"] 7["Param"] 8["b"] 9["Param"] 1 --> 5 3 --> 2 4 --> 6 5 --> 4 6 -- match --> 7 7 --> 8 8 -- match --> 9 9 --> 14 10 --> 3 11 --> 12 12 --> 15 13 --> 10 14 --> 11 15 --> 17 16 --> 13 17 --> 16
DCA looks fine I think. There seems to be an extraction error for googleapis-tonic, but that must be unrelated.
Currently
self
parameters are not included in the CFG. This PR adds them.This example:
results in this CFG (previously the 2nd and 3rd node where not there):