diff --git a/source/fuzz/fuzzer_pass_add_function_calls.cpp b/source/fuzz/fuzzer_pass_add_function_calls.cpp index b6f4c85d07..74005579c4 100644 --- a/source/fuzz/fuzzer_pass_add_function_calls.cpp +++ b/source/fuzz/fuzzer_pass_add_function_calls.cpp @@ -141,9 +141,13 @@ std::vector FuzzerPassAddFunctionCalls::ChooseFunctionCallArguments( assert(param_type && "Parameter has invalid type"); if (!param_type->AsPointer()) { - // We mark the constant as irrelevant so that we can replace it with a - // more interesting value later. - result.push_back(FindOrCreateZeroConstant(param->type_id(), true)); + if (fuzzerutil::CanCreateConstant(GetIRContext(), param->type_id())) { + // We mark the constant as irrelevant so that we can replace it with a + // more interesting value later. + result.push_back(FindOrCreateZeroConstant(param->type_id(), true)); + } else { + result.push_back(FindOrCreateGlobalUndef(param->type_id())); + } continue; }