summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2020-10-05 10:30:27 -0700
committerGitHub <noreply@github.com>2020-10-05 10:30:27 -0700
commitd930c65e7fef6414af363e1f8d4fff52beb448af (patch)
tree39a4ea4bbd7bbbdbb2825cd5701cee919765c687 /source
parent3321df74904dfe3a11a41179b66a4c3ce5b57022 (diff)
Update the type of a call inst during specialization. (#1569)
Diffstat (limited to 'source')
-rw-r--r--source/slang/slang-ir-specialize.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/slang/slang-ir-specialize.cpp b/source/slang/slang-ir-specialize.cpp
index ceba4b03c..caaa700a0 100644
--- a/source/slang/slang-ir-specialize.cpp
+++ b/source/slang/slang-ir-specialize.cpp
@@ -901,6 +901,12 @@ struct SpecializationContext
if(!calleeFunc)
return;
+ // Update result type since the callee may have been changed.
+ if (inst->getDataType() != calleeFunc->getResultType())
+ {
+ inst->setFullType(calleeFunc->getResultType());
+ }
+
// We can only specialize if we have access to a body for the callee.
//
if(!calleeFunc->isDefinition())