diff options
Diffstat (limited to 'src/tools/fuzzing.h')
-rw-r--r-- | src/tools/fuzzing.h | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/tools/fuzzing.h b/src/tools/fuzzing.h index ebc77ab43..e53665e14 100644 --- a/src/tools/fuzzing.h +++ b/src/tools/fuzzing.h @@ -148,11 +148,18 @@ public: struct AutoNester { TranslateToFuzzReader& parent; + size_t amount = 1; AutoNester(TranslateToFuzzReader& parent) : parent(parent) { parent.nesting++; } - ~AutoNester() { parent.nesting--; } + ~AutoNester() { parent.nesting -= amount; } + + // Add more nesting manually. + void add(size_t more) { + parent.nesting += more; + amount += more; + } }; private: @@ -289,10 +296,10 @@ private: // we may add a GC cast to fixup the type. Expression* makeConst(Type type); - // Like makeConst, but for a type that is a reference type. One function - // handles basic types, and the other compound ones. - Expression* makeConstBasicRef(Type type); - Expression* makeConstCompoundRef(Type type); + // Generate reference values. One function handles basic types, and the other + // compound ones. + Expression* makeBasicRef(Type type); + Expression* makeCompoundRef(Type type); Expression* buildUnary(const UnaryArgs& args); Expression* makeUnary(Type type); @@ -319,7 +326,6 @@ private: Expression* makeRefEq(Type type); Expression* makeRefTest(Type type); Expression* makeRefCast(Type type); - Expression* makeI31New(Type type); Expression* makeI31Get(Type type); Expression* makeMemoryInit(); Expression* makeDataDrop(); |