From d930c65e7fef6414af363e1f8d4fff52beb448af Mon Sep 17 00:00:00 2001 From: Yong He Date: Mon, 5 Oct 2020 10:30:27 -0700 Subject: Update the type of a call inst during specialization. (#1569) --- source/slang/slang-ir-specialize.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source') 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()) -- cgit v1.2.3