summaryrefslogtreecommitdiff
path: root/source/slang/slang-emit-c-like.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2020-06-19 11:19:51 -0700
committerGitHub <noreply@github.com>2020-06-19 11:19:51 -0700
commit110d15b61ac5d76da001d412eaa4be07f3cd8f4d (patch)
tree6d2cef5dab495b484844b4d54c312751af62091e /source/slang/slang-emit-c-like.cpp
parent5fbb9ff7e1516bd787695d2c9d80b696f0a9ca9a (diff)
Dynamic dispatch for static member functions of associatedtypes. (#1404)
Diffstat (limited to 'source/slang/slang-emit-c-like.cpp')
-rw-r--r--source/slang/slang-emit-c-like.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/source/slang/slang-emit-c-like.cpp b/source/slang/slang-emit-c-like.cpp
index 6c004c84c..3438fd3f4 100644
--- a/source/slang/slang-emit-c-like.cpp
+++ b/source/slang/slang-emit-c-like.cpp
@@ -237,18 +237,15 @@ List<IRWitnessTableEntry*> CLikeSourceEmitter::getSortedWitnessTableEntries(IRWi
for (UInt i = 0; i < interfaceType->getOperandCount(); i++)
{
auto reqKey = cast<IRStructKey>(interfaceType->getOperand(i));
- bool matchingEntryFound = false;
IRWitnessTableEntry* entry = nullptr;
if (witnessTableEntryDictionary.TryGetValue(reqKey, entry))
{
- if (entry->requirementKey.get() == reqKey)
- {
- matchingEntryFound = true;
- sortedWitnessTableEntries.add(entry);
- break;
- }
+ sortedWitnessTableEntries.add(entry);
+ }
+ else
+ {
+ SLANG_UNREACHABLE("interface requirement key not found in witness table.");
}
- SLANG_ASSERT(matchingEntryFound);
}
return sortedWitnessTableEntries;
}