-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlaaf_mutator_llm.h
More file actions
42 lines (37 loc) · 1.7 KB
/
Copy pathlaaf_mutator_llm.h
File metadata and controls
42 lines (37 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#ifndef LAAF_MUTATOR_LLM_H_
#define LAAF_MUTATOR_LLM_H_
#include "laaf_mutator.h"
// ============================================================
// M13: Syntax Edge Injection (LLM-generated)
// Targets: PushCaret, PushDollar, PushWordBoundary, PushDot,
// PushSimpleOp, DoLeftParen, DoLeftParenNoCapture
// ============================================================
class SyntaxEdgeMutator : public Mutator {
public:
const char* name() const override { return "syntax_edge"; }
bool can_mutate(const Slot& slot) const override;
bool mutate(re2::Regexp* root, const std::vector<Slot>& slots, RNG& rng) override;
};
// ============================================================
// M14: Case-Fold & Encoding Stress (LLM-generated)
// Targets: LookupCaseFold, CycleFoldRune, ConvertLatin1ToUTF8,
// AddFoldedRangeLatin1, rune_max
// ============================================================
class CaseFoldMutator : public Mutator {
public:
const char* name() const override { return "case_fold"; }
bool can_mutate(const Slot& slot) const override;
bool mutate(re2::Regexp* root, const std::vector<Slot>& slots, RNG& rng) override;
};
// ============================================================
// M15: Walker Boundary Stress (LLM-generated)
// Targets: all Walker::ShortVisit paths by generating patterns
// that exceed walk budget (1M visits)
// ============================================================
class WalkerStressMutator : public Mutator {
public:
const char* name() const override { return "walker_stress"; }
bool can_mutate(const Slot& slot) const override;
bool mutate(re2::Regexp* root, const std::vector<Slot>& slots, RNG& rng) override;
};
#endif