File tree Expand file tree Collapse file tree 3 files changed +59
-1
lines changed
src/main/java/com/code_intelligence/jazzer/instrumentor
src/test/java/com/example Expand file tree Collapse file tree 3 files changed +59
-1
lines changed Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ internal class TraceDataFlowInstrumentor(
5252 }
5353 }
5454
55- val writer = ClassWriter (ClassWriter .COMPUTE_MAXS )
55+ val writer = ClassWriter (reader, ClassWriter .COMPUTE_MAXS )
5656 node.accept(writer)
5757 return writer.toByteArray()
5858 }
Original file line number Diff line number Diff line change @@ -1077,6 +1077,37 @@ java_fuzz_target_test(
10771077 ],
10781078)
10791079
1080+ java_fuzz_target_test (
1081+ name = "NestedRecordFuzzer" ,
1082+ timeout = "short" ,
1083+ srcs = [
1084+ "src/test/java/com/example/NestedRecordFuzzer.java" ,
1085+ ],
1086+ # This regression test checks if we instrument fuzz test classes with nested records correctly,
1087+ # and can start a fuzzing run at all without getting segfaults.
1088+ fuzzer_args = [
1089+ "-print_final_stats=1" ,
1090+ "-runs=1" ,
1091+ ],
1092+ javacopts = [
1093+ "--release" ,
1094+ "17" ,
1095+ ],
1096+ tags = [
1097+ "no-jdk8" ,
1098+ ],
1099+ target_class = "com.example.NestedRecordFuzzer" ,
1100+ runtime_deps = [
1101+ "@maven//:org_junit_jupiter_junit_jupiter_engine" ,
1102+ ],
1103+ deps = [
1104+ "//deploy:jazzer-junit" ,
1105+ "//deploy:jazzer-project" ,
1106+ "@maven//:org_junit_jupiter_junit_jupiter_api" ,
1107+ "@maven//:org_junit_jupiter_junit_jupiter_params" ,
1108+ ],
1109+ )
1110+
10801111java_fuzz_target_test (
10811112 name = "BigDecimalFuzzer" ,
10821113 srcs = [
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright 2024 Code Intelligence GmbH
3+ *
4+ * Licensed under the Apache License, Version 2.0 (the "License");
5+ * you may not use this file except in compliance with the License.
6+ * You may obtain a copy of the License at
7+ *
8+ * http://www.apache.org/licenses/LICENSE-2.0
9+ *
10+ * Unless required by applicable law or agreed to in writing, software
11+ * distributed under the License is distributed on an "AS IS" BASIS,
12+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ * See the License for the specific language governing permissions and
14+ * limitations under the License.
15+ */
16+
17+ package com .example ;
18+
19+ import com .code_intelligence .jazzer .junit .FuzzTest ;
20+ import com .code_intelligence .jazzer .mutation .annotation .NotNull ;
21+
22+ public class NestedRecordFuzzer {
23+ record Address (@ NotNull String street , String city , String zipCode ) {}
24+
25+ @ FuzzTest
26+ public void test (Address ignored ) {}
27+ }
You can’t perform that action at this time.
0 commit comments