diff options
author | Neelesh Chandola <neelesh.chandola@outlook.com> | 2018-12-13 13:59:46 +0530 |
---|---|---|
committer | Neelesh Chandola <neelesh.chandola@outlook.com> | 2018-12-13 13:59:46 +0530 |
commit | b2411db54119ea00296d12a47bd12a371bc0a4ba (patch) | |
tree | 79d537e3066eb5c9778df62faa3a53445a190892 /compiler | |
parent | abcf4d8b5dd4988c952a232d4a610d0491ff79ff (diff) | |
parent | a3c4791e9cde49f44e7261044cc84fa863bc717c (diff) | |
download | Nim-b2411db54119ea00296d12a47bd12a371bc0a4ba.tar.gz |
Merge remote-tracking branch 'upstream/devel' into record-case
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/cmdlinehelper.nim | 12 | ||||
-rw-r--r-- | compiler/extccomp.nim | 2 | ||||
-rw-r--r-- | compiler/semstmts.nim | 4 |
3 files changed, 16 insertions, 2 deletions
diff --git a/compiler/cmdlinehelper.nim b/compiler/cmdlinehelper.nim index 8bd073314..9fbf4a0b0 100644 --- a/compiler/cmdlinehelper.nim +++ b/compiler/cmdlinehelper.nim @@ -48,6 +48,15 @@ proc loadConfigsAndRunMainCommand*(self: NimProg, cache: IdentCache; conf: Confi if self.suggestMode: conf.command = "nimsuggest" + # These defines/options should not be enabled while processing nimscript + # bug #4446, #9420, #8991, #9589, #9153 + undefSymbol(conf.symbols, "profiler") + undefSymbol(conf.symbols, "memProfiler") + undefSymbol(conf.symbols, "nodejs") + + # bug #9120 + conf.globalOptions.excl(optTaintMode) + proc runNimScriptIfExists(path: AbsoluteFile)= if fileExists(path): runNimScript(cache, path, freshDefines = false, conf) @@ -79,6 +88,9 @@ proc loadConfigsAndRunMainCommand*(self: NimProg, cache: IdentCache; conf: Confi # 'nimsuggest foo.nims' means to just auto-complete the NimScript file discard + # Reload configuration from .cfg file + loadConfigs(DefaultConfig, cache, conf) + # now process command line arguments again, because some options in the # command line can overwite the config file's settings extccomp.initVars(conf) diff --git a/compiler/extccomp.nim b/compiler/extccomp.nim index 4b9e1c6fe..23f723e29 100644 --- a/compiler/extccomp.nim +++ b/compiler/extccomp.nim @@ -780,7 +780,7 @@ proc linkViaResponseFile(conf: ConfigRef; cmd: string) = let linkerArgs = conf.projectName & "_" & "linkerArgs.txt" let args = cmd.substr(i) # GCC's response files don't support backslashes. Junk. - if conf.cCompiler == ccGcc: + if conf.cCompiler == ccGcc or conf.cCompiler == ccCLang: writeFile(linkerArgs, args.replace('\\', '/')) else: writeFile(linkerArgs, args) diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim index d81410891..65df29913 100644 --- a/compiler/semstmts.nim +++ b/compiler/semstmts.nim @@ -800,11 +800,13 @@ proc semCase(c: PContext, n: PNode; flags: TExprFlags): PNode = typ = commonType(typ, x.sons[1]) closeScope(c) of nkElse: - chckCovered = false checkSonsLen(x, 1, c.config) x.sons[0] = semExprBranchScope(c, x.sons[0]) typ = commonType(typ, x.sons[0]) hasElse = true + if chckCovered and covered == toCover(c, n.sons[0].typ): + localError(c.config, x.info, "invalid else, all cases are already covered") + chckCovered = false else: illFormedAst(x, c.config) if chckCovered: |