mirror of
https://github.com/KhronosGroup/glslang
synced 2024-09-19 20:29:54 +00:00
Add an assert that ID operands are non-zero
Zero is not a valid ID value and the SPIR-V emitter library should never be emitting instructions with ID values of 0.
This commit is contained in:
parent
d89c0b1d13
commit
3ebb72cc74
@ -97,6 +97,8 @@ public:
|
||||
explicit Instruction(Op opCode) : resultId(NoResult), typeId(NoType), opCode(opCode), block(nullptr) { }
|
||||
virtual ~Instruction() {}
|
||||
void addIdOperand(Id id) {
|
||||
// ids can't be 0
|
||||
assert(id);
|
||||
operands.push_back(id);
|
||||
idOperand.push_back(true);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user