summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorReimer Behrends <behrends@gmail.com>2014-09-10 01:22:20 +0200
committerReimer Behrends <behrends@gmail.com>2014-09-10 01:22:20 +0200
commitf9c46b04a61c2ea1362b33e69c6e211f2d225354 (patch)
tree18c336547b09bfab1feb0117e7cde8777c0a5055
parent43f78d2c4a3d8dccec5c9e8a156e95f00f307efd (diff)
downloadNim-f9c46b04a61c2ea1362b33e69c6e211f2d225354.tar.gz
Properly handle staticExec() generating large output.
A staticExec() invocation that generated more than the internal
buffer size worth of output blocked because the compiler waited
for the process to terminate before reading the output.
-rw-r--r--compiler/vmdeps.nim2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/vmdeps.nim b/compiler/vmdeps.nim
index 9a213d813..fdd8276cc 100644
--- a/compiler/vmdeps.nim
+++ b/compiler/vmdeps.nim
@@ -12,11 +12,11 @@ import ast, types, msgs, osproc, streams, options
 proc readOutput(p: PProcess): string =
   result = ""
   var output = p.outputStream
-  discard p.waitForExit
   while not output.atEnd:
     result.add(output.readLine)
     result.add("\n")
   result.setLen(result.len - "\n".len)
+  discard p.waitForExit
 
 proc opGorge*(cmd, input: string): string =
   var p = startCmd(cmd)