From 0c87001d7fb9dabaa17f9784e99d7438592d2373 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Mon, 6 Jan 2020 15:36:11 -0500 Subject: Fix scoping issue around use of IRTypeSet (#1160) * WIP use IRTypeSet in CPPSourceEmitter - doesn't work because of a cloning issue, causing a crash on exit. * Fix destruction of module issue for IRTypeSet usage in CPPEmitter. * Fix out definition emitting ordering that was removed. * Disable cuda output test. --- source/slang/slang-emit.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source/slang/slang-emit.cpp') diff --git a/source/slang/slang-emit.cpp b/source/slang/slang-emit.cpp index 19c3cad68..66e5714c3 100644 --- a/source/slang/slang-emit.cpp +++ b/source/slang/slang-emit.cpp @@ -466,6 +466,10 @@ String emitEntryPointSourceFromIR( desc.effectiveProfile = getEffectiveProfile(entryPoint, targetRequest); desc.sourceWriter = &sourceWriter; + // Define here, because must be in scope longer than the sourceEmitter, as sourceEmitter might reference + // items in the linkedIR module + LinkedIR linkedIR; + RefPtr sourceEmitter; typedef CLikeSourceEmitter::SourceStyle SourceStyle; @@ -502,8 +506,6 @@ String emitEntryPointSourceFromIR( return String(); } - // Outside because we want to keep IR in scope whilst we are processing emits - LinkedIR linkedIR; { LinkingAndOptimizationOptions linkingAndOptimizationOptions; -- cgit v1.2.3