diff options
| author | Yong He <yonghe@outlook.com> | 2020-10-05 10:30:27 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-10-05 10:30:27 -0700 |
| commit | d930c65e7fef6414af363e1f8d4fff52beb448af (patch) | |
| tree | 39a4ea4bbd7bbbdbb2825cd5701cee919765c687 /source | |
| parent | 3321df74904dfe3a11a41179b66a4c3ce5b57022 (diff) | |
Update the type of a call inst during specialization. (#1569)
Diffstat (limited to 'source')
| -rw-r--r-- | source/slang/slang-ir-specialize.cpp | 6 |
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()) |
