Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix Issue 6743 - ICE(mars.c) attempting to compile an exe file

  • Loading branch information...
commit 56b6293b7f37f82fa7a4a6ce00fa1e3e79feb788 1 parent 171cda8
@WalterBright WalterBright authored
Showing with 8 additions and 0 deletions.
  1. +8 −0 src/mars.c
View
8 src/mars.c
@@ -856,6 +856,14 @@ int main(size_t argc, char *argv[])
global.params.runargs_length = ((i >= argcstart) ? argc : argcstart) - i - 1;
if (global.params.runargs_length)
{
+ char *ext = FileName::ext(argv[i + 1]);
+ if (ext && FileName::equals(ext, "d") == 0
+ && FileName::equals(ext, "di") == 0)
+ {
+ error(0, "-run must be followed by a source file, not '%s'", argv[i + 1]);
+ break;
+ }
+
files.push(argv[i + 1]);
global.params.runargs = &argv[i + 2];
i += global.params.runargs_length;
Please sign in to comment.
Something went wrong with that request. Please try again.