Bug 1583408 - Handle uncompleted scripts correctly in LCov code. r=nbp
authorTed Campbell <tcampbell@mozilla.com>
Tue, 24 Sep 2019 10:25:27 +0000
changeset 494667 95a274d7de37e77c1edd7f535de702a60bfdde51
parent 494666 a1642f87566639353e8bc548023c5d499fd8e78a
child 494668 90e37db667c1d355673534b5c59cf02c1e1d8a30
push id36612
push usercbrindusan@mozilla.com
push dateTue, 24 Sep 2019 16:10:49 +0000
treeherdermozilla-central@d24d00b719aa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnbp
bugs1583408
milestone71.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1583408 - Handle uncompleted scripts correctly in LCov code. r=nbp When a JSScript is partially initialized we must detect this and not generate coverage information. This incomplete script may still have an entry in the ScriptLCovMap. The existing collectCodeCoverageInfo code handled this correctly but the new CollectScriptCoverage function did not. Differential Revision: https://phabricator.services.mozilla.com/D46888
js/src/vm/CodeCoverage.cpp
--- a/js/src/vm/CodeCoverage.cpp
+++ b/js/src/vm/CodeCoverage.cpp
@@ -740,14 +740,16 @@ void CollectScriptCoverage(JSScript* scr
   }
 
   auto p = map->lookup(script);
   if (!p.found()) {
     return;
   }
 
   LCovSource* source = p->value();
-  source->writeScript(script);
+  if (!script->isUncompleted()) {
+    source->writeScript(script);
+  }
   map->remove(p);
 }
 
 }  // namespace coverage
 }  // namespace js