summaryrefslogtreecommitdiffstats
path: root/source/slang/slang.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2024-10-28 08:53:41 -0700
committerGitHub <noreply@github.com>2024-10-28 08:53:41 -0700
commit04329077988a2b1f7a87b1d116457599039e5e12 (patch)
tree86b29e773f04f0926cc7685766d0a0b135c90500 /source/slang/slang.cpp
parenta3276e2876be00fd4b0a69e47a66b1cff29765f2 (diff)
More wasm binding for playground. (#5420)
Diffstat (limited to 'source/slang/slang.cpp')
-rw-r--r--source/slang/slang.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/source/slang/slang.cpp b/source/slang/slang.cpp
index b77a3efc8..b3ac7f73d 100644
--- a/source/slang/slang.cpp
+++ b/source/slang/slang.cpp
@@ -5040,13 +5040,21 @@ IArtifact* ComponentType::getTargetArtifact(Int targetIndex, slang::IBlob** outD
});
List<RefPtr<ComponentType>> components;
components.add(this);
+ bool entryPointsDiscovered = false;
for (auto module : modules)
{
for (auto entryPoint : module->getEntryPoints())
{
components.add(entryPoint);
+ entryPointsDiscovered = true;
}
}
+ // If no entry points were discovered, then we should return nullptr.
+ if (!entryPointsDiscovered)
+ {
+ return nullptr;
+ }
+
RefPtr<CompositeComponentType> composite = new CompositeComponentType(linkage, components);
ComPtr<IComponentType> linkedComponentType;
SLANG_RETURN_NULL_ON_FAIL(composite->link(linkedComponentType.writeRef(), outDiagnostics));