SPV: Protect getStorageClass() with a test that the thing is pointer.
This commit is contained in:
parent
33661450c7
commit
e00e72ded1
6 changed files with 128 additions and 5 deletions
|
|
@ -293,7 +293,12 @@ public:
|
|||
|
||||
Instruction* getInstruction(Id id) const { return idToInstruction[id]; }
|
||||
spv::Id getTypeId(Id resultId) const { return idToInstruction[resultId]->getTypeId(); }
|
||||
StorageClass getStorageClass(Id typeId) const { return (StorageClass)idToInstruction[typeId]->getImmediateOperand(0); }
|
||||
StorageClass getStorageClass(Id typeId) const
|
||||
{
|
||||
assert(idToInstruction[typeId]->getOpCode() == spv::OpTypePointer);
|
||||
return (StorageClass)idToInstruction[typeId]->getImmediateOperand(0);
|
||||
}
|
||||
|
||||
void dump(std::vector<unsigned int>& out) const
|
||||
{
|
||||
for (int f = 0; f < (int)functions.size(); ++f)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue