mirror of
https://github.com/KhronosGroup/SPIRV-Tools
synced 2024-10-18 11:10:05 +00:00
spirv-fuzz: Pass OpUndef in function call if needed (#3978)
Fixes #3977.
This commit is contained in:
parent
de2c0ba202
commit
53f2a69c19
@ -141,9 +141,13 @@ std::vector<uint32_t> 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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user