summaryrefslogtreecommitdiffstats
path: root/source/slang/slang.cpp
diff options
context:
space:
mode:
authorTim Foley <tfoleyNV@users.noreply.github.com>2018-02-01 14:41:34 -0800
committerGitHub <noreply@github.com>2018-02-01 14:41:34 -0800
commit652a3c987d2b42d069bf54ba251126208d00d9e7 (patch)
tree890a7d4d5259026fb6833ba416022fddd60343e3 /source/slang/slang.cpp
parent4583e395ad503b63343a14adaeb621dee8a8da71 (diff)
Fix a bug in import handling (#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.
Diffstat (limited to 'source/slang/slang.cpp')
-rw-r--r--source/slang/slang.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/source/slang/slang.cpp b/source/slang/slang.cpp
index 688593529..0ba3e790c 100644
--- a/source/slang/slang.cpp
+++ b/source/slang/slang.cpp
@@ -575,7 +575,10 @@ RefPtr<ModuleDecl> CompileRequest::findOrImportModule(
{
// We seem to be in the middle of loading this module
mSink.diagnose(loc, Diagnostics::recursiveModuleImport, name);
+ return nullptr;
}
+
+ return loadedModule->moduleDecl;
}
// Derive a file name for the module, by taking the given