summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2024-05-31 22:08:27 -0700
committerGitHub <noreply@github.com>2024-05-31 22:08:27 -0700
commita5cdb574b391e8adce1ce71e1e7ab3a20ce15818 (patch)
treef853363b68186888d7478da0e89cb38ee1daab2e /source
parentfebbeb140bea65180ff4be9b164207c582235d4d (diff)
Fix a bug on default initialization of interface typed value. (#4249)
* Fix a bug on default initialization of interface typed value. * Fix.
Diffstat (limited to 'source')
-rw-r--r--source/slang/slang-lower-to-ir.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/slang/slang-lower-to-ir.cpp b/source/slang/slang-lower-to-ir.cpp
index 8a8d235f5..80e73fe2b 100644
--- a/source/slang/slang-lower-to-ir.cpp
+++ b/source/slang/slang-lower-to-ir.cpp
@@ -4413,6 +4413,10 @@ struct ExprLoweringVisitorBase : public ExprVisitor<Derived, LoweredValInfo>
{
return LoweredValInfo::simple(getBuilder()->getIntValue(irType, 0));
}
+ else if (declRef.as<InterfaceDecl>())
+ {
+ return LoweredValInfo::simple(getBuilder()->emitDefaultConstruct(irType));
+ }
else if (auto aggTypeDeclRef = declRef.as<AggTypeDecl>())
{
List<IRInst*> args;