Skip to content
Open
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import com.code_intelligence.jazzer.mutation.combinator.MutatorCombinators;
import com.code_intelligence.jazzer.mutation.engine.SeededPseudoRandom;
import com.code_intelligence.jazzer.mutation.mutator.Mutators;
import com.code_intelligence.jazzer.mutation.runtime.MutationRuntime;
import com.code_intelligence.jazzer.mutation.support.Preconditions;
import com.code_intelligence.jazzer.utils.Log;
import java.io.ByteArrayInputStream;
Expand Down Expand Up @@ -97,6 +98,8 @@ public static Optional<ArgumentsMutator> forMethod(
Log.error(validationError.getMessage());
throw validationError;
}
MutationRuntime.fuzzTestMethod = method;
DictionaryProvider[] typeDictionaries = method.getAnnotationsByType(DictionaryProvider.class);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: This probably belongs to the next commit.

return toArrayOrEmpty(
stream(method.getAnnotatedParameterTypes())
.map(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ java_library(
"//src/main/java/com/code_intelligence/jazzer/mutation/combinator",
"//src/main/java/com/code_intelligence/jazzer/mutation/engine",
"//src/main/java/com/code_intelligence/jazzer/mutation/mutator",
"//src/main/java/com/code_intelligence/jazzer/mutation/runtime",
"//src/main/java/com/code_intelligence/jazzer/mutation/support",
"//src/main/java/com/code_intelligence/jazzer/utils:log",
],
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
java_library(
name = "runtime",
srcs = glob(["*.java"]),
visibility = [
"//selffuzz/src/test/java/com/code_intelligence/selffuzz/mutation/mutator/lang:__pkg__",
"//src/main/java/com/code_intelligence/jazzer/mutation:__pkg__",
"//src/main/java/com/code_intelligence/jazzer/mutation:__subpackages__",
"//src/test/java/com/code_intelligence/jazzer/mutation:__pkg__",
"//src/test/java/com/code_intelligence/jazzer/mutation:__subpackages__",
],
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* Copyright 2024 Code Intelligence GmbH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.code_intelligence.jazzer.mutation.runtime;

import java.lang.reflect.Method;

/** Runtime information to be used by mutators. */
public class MutationRuntime {
/** The fuzz test method currently being executed. */
public static Method fuzzTestMethod;
}