Skip to content

Commit 3c042c5

Browse files
authored
Allow OpPoisonKHR definition on the top of the module (KhronosGroup#6699)
Currently it's not allowed by the spec, but it's arguably a specification bug.
1 parent 6aa5c1d commit 3c042c5

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

source/val/validate_misc.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ spv_result_t ValidateAbort(ValidationState_t& _, const Instruction* inst) {
133133
spv_result_t MiscPass(ValidationState_t& _, const Instruction* inst) {
134134
switch (inst->opcode()) {
135135
case spv::Op::OpUndef:
136+
case spv::Op::OpPoisonKHR:
136137
if (auto error = ValidateUndef(_, inst)) return error;
137138
break;
138139
default:

source/val/validation_state.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ ModuleLayoutSection InstructionLayoutSection(
107107
return kLayoutFunctionDefinitions;
108108
case spv::Op::OpLine:
109109
case spv::Op::OpNoLine:
110+
case spv::Op::OpPoisonKHR:
110111
case spv::Op::OpUndef:
111112
if (current_section == kLayoutTypes) return kLayoutTypes;
112113
return kLayoutFunctionDefinitions;

0 commit comments

Comments
 (0)