From 7c31110bfd6a82796ae009c1ecc3c9d2b16bbd72 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Fri, 17 Feb 2023 08:53:16 -0800 Subject: [Strings] Start some basic fuzzing support for strings (#5499) This is necessary to avoid fuzzer breakage after #5497 as it added a test with strings. We could also ignore that file, like we do for other string files, but this was not much work so just implement it. --- src/tools/fuzzing/fuzzing.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/tools/fuzzing/fuzzing.cpp') diff --git a/src/tools/fuzzing/fuzzing.cpp b/src/tools/fuzzing/fuzzing.cpp index 37de3d1da..4dac794e2 100644 --- a/src/tools/fuzzing/fuzzing.cpp +++ b/src/tools/fuzzing/fuzzing.cpp @@ -2116,6 +2116,7 @@ Expression* TranslateToFuzzReader::makeConstBasicRef(Type type) { return builder.makeArrayInit(trivialArray, {}); } case HeapType::string: + return builder.makeStringConst(std::to_string(upTo(1024))); case HeapType::stringview_wtf8: case HeapType::stringview_wtf16: case HeapType::stringview_iter: @@ -3224,6 +3225,7 @@ HeapType TranslateToFuzzReader::getSubType(HeapType type) { case HeapType::array: return pick(HeapType::array, HeapType::none); case HeapType::string: + return HeapType::string; case HeapType::stringview_wtf8: case HeapType::stringview_wtf16: case HeapType::stringview_iter: -- cgit v1.2.3