Created IterateInline8bitCounters, a single template for visiting Inline8bitCounters (nested for loop)
Made InitializeUnstableCounters and UpdateUnstableCounters both send a lambda to IterateInline8bitCounters.
Patch by Kyungtak Woo (@kevinwkt).
Differential D49453
[libFuzzer] Create single template for visiting Inline8bitCounters kevinwkt on Jul 17 2018, 2:03 PM. Authored by
Details Created IterateInline8bitCounters, a single template for visiting Inline8bitCounters (nested for loop) Patch by Kyungtak Woo (@kevinwkt).
Diff Detail
Event TimelineComment Actions Left some minor comments, but I think it's fine to ask Matt or Kostya to take a look and address all the feedback altogether, just to avoid changing things back and forth if we have different opinions.
Comment Actions Changed beg to Counter for both InitializeUnstableCounters and UpdateUnstableCounters. Comment Actions Maybe change the callback signature to take i, j, and UnstableIdx instead. Then we can also use IterateInline8bitCounters from UpdateObservedPCs.
Comment Actions PTAL Did not use template function for case: NumGuards == NumPCsInPCTables because of initial check in template function. Comment Actions ptal
Comment Actions ptal: fixed |
nit: not a language expert myself, but maybe this should be IterateOverInline8bitCounters. Current version LGTM as well.