spirv-fuzz: Fix to operand id type (#3937)
Fixes #3934.
diff --git a/source/fuzz/transformation_replace_branch_from_dead_block_with_exit.cpp b/source/fuzz/transformation_replace_branch_from_dead_block_with_exit.cpp
index 561e8b6..e809012 100644
--- a/source/fuzz/transformation_replace_branch_from_dead_block_with_exit.cpp
+++ b/source/fuzz/transformation_replace_branch_from_dead_block_with_exit.cpp
@@ -117,7 +117,7 @@
opt::Instruction::OperandList new_terminator_in_operands;
if (message_.opcode() == SpvOpReturnValue) {
new_terminator_in_operands.push_back(
- {SPV_OPERAND_TYPE_TYPE_ID, {message_.return_value_id()}});
+ {SPV_OPERAND_TYPE_ID, {message_.return_value_id()}});
}
auto terminator = block->terminator();
terminator->SetOpcode(static_cast<SpvOp>(message_.opcode()));
diff --git a/test/fuzz/transformation_replace_branch_from_dead_block_with_exit_test.cpp b/test/fuzz/transformation_replace_branch_from_dead_block_with_exit_test.cpp
index ddf5d11..4532503 100644
--- a/test/fuzz/transformation_replace_branch_from_dead_block_with_exit_test.cpp
+++ b/test/fuzz/transformation_replace_branch_from_dead_block_with_exit_test.cpp
@@ -337,6 +337,12 @@
ASSERT_TRUE(fuzzerutil::IsValidAndWellFormed(context.get(), validator_options,
kConsoleMessageConsumer));
+ opt::Instruction* return_value_inst =
+ context->get_instr_block(201)->terminator();
+ ASSERT_EQ(SpvOpReturnValue, return_value_inst->opcode());
+ ASSERT_EQ(SPV_OPERAND_TYPE_ID, return_value_inst->GetInOperand(0).type);
+ ASSERT_EQ(400, return_value_inst->GetSingleWordInOperand(0));
+
std::string after_transformation = R"(
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"