Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/dmd/mars.d
Original file line number Diff line number Diff line change
Expand Up @@ -880,6 +880,12 @@ private int tryMain(size_t argc, const(char)** argv)
}
else
{
if (global.params.objfiles.dim == 0)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wilzbach indentation seems to suggest you missed braces.

{
error(Loc.initial, "-X requires source files");
fatal();
}

// Generate json file name from first obj name
const(char)* n = global.params.objfiles[0];
n = FileName.name(n);
Expand Down
11 changes: 11 additions & 0 deletions test/compilable/test18367.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash
Copy link
Contributor

@marler8997 marler8997 Feb 6, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this whole file is bash wizadry...I can see one is strong with the bash

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I copied this test to my PR, and added another case to it


set -u -o pipefail

name=$(basename "$0" .sh)
dir=${RESULTS_DIR}/compilable/

# dmd should not segfault on -X with libraries, but no source files
out=$("$DMD" -conf= -X foo.a 2>&1)
[ $? -eq 1 ] || exit 1
echo "$out" | grep -q "Error: -X requires source files"