diff --git a/src/com/google/javascript/jscomp/Compiler.java b/src/com/google/javascript/jscomp/Compiler.java
index <HASH>..<HASH> 100644
--- a/src/com/google/javascript/jscomp/Compiler.java
+++ b/src/com/google/javascript/jscomp/Compiler.java
@@ -1164,6 +1164,11 @@ public class Compiler extends AbstractCompiler implements ErrorHandler, SourceFi
   }
 
   final String getCurrentJsSource() {
+    SourceMap sourceMap = getSourceMap();
+    if (sourceMap != null) {
+      sourceMap.reset();
+    }
+
     List<String> fileNameRegexList = options.filesToPrintAfterEachPassRegexList;
     List<String> moduleNameRegexList = options.modulesToPrintAfterEachPassRegexList;
     StringBuilder builder = new StringBuilder();
Call SourceMap.reset() before generating code for the --print_source_after_each_pass flag and similar flags.

Otherwise (if source maps are enabled) we get a Preconditions failure when trying to generate code the second time.

-------------
Created by MOE: <URL>