Skip to content

Commit 652a3c9

Browse files
author
Tim Foley
authoredFeb 1, 2018
Fix a bug in import handling (shader-slang#394)
The recent change that removed `#import` accidentally introduced a regression that made *any* code that imports the same module in more than one place fail. I'm just fixing the bug for now to unblock users, but this should really get a regression test.
1 parent 4583e39 commit 652a3c9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed
 

‎source/slang/slang.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,10 @@ RefPtr<ModuleDecl> CompileRequest::findOrImportModule(
575575
{
576576
// We seem to be in the middle of loading this module
577577
mSink.diagnose(loc, Diagnostics::recursiveModuleImport, name);
578+
return nullptr;
578579
}
580+
581+
return loadedModule->moduleDecl;
579582
}
580583

581584
// Derive a file name for the module, by taking the given

0 commit comments

Comments
 (0)
Please sign in to comment.