-
Notifications
You must be signed in to change notification settings - Fork 664
spirv-opt: DominatorAnalysis::Dominates does not handle OpLabel instructions #3515
Copy link
Copy link
Closed
Description
The following test is supposed to fail.
TEST(SegfaultTest, Segfault) {
std::string shader = R"(
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %4 "main"
OpExecutionMode %4 OriginUpperLeft
OpSource ESSL 320
%2 = OpTypeVoid
%3 = OpTypeFunction %2
%4 = OpFunction %2 None %3
%5 = OpLabel
%6 = OpUndef %2
OpReturn
OpFunctionEnd
)";
const auto env = SPV_ENV_UNIVERSAL_1_3;
const auto consumer = nullptr;
const auto context = BuildModule(env, consumer, shader, kFuzzAssembleOption);
ASSERT_TRUE(IsValid(env, context.get()));
const auto& function = *context->module()->begin();
auto* op_label = context->get_def_use_mgr()->GetDef(5);
auto* op_undef = context->get_def_use_mgr()->GetDef(6);
ASSERT_EXIT(context->GetDominatorAnalysis(&function)->Dominates(
op_label, op_undef),
::testing::KilledBySignal(SIGSEGV), ".*");
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels