From 6a90d39a93802ff03b853f9b7ace5b572d679066 Mon Sep 17 00:00:00 2001 From: Ted Campbell Date: Tue, 24 Sep 2019 10:25:27 +0000 Subject: [PATCH] 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 --HG-- extra : moz-landing-system : lando --- js/src/vm/CodeCoverage.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/src/vm/CodeCoverage.cpp b/js/src/vm/CodeCoverage.cpp index dab61af00746..0e156ad5bc43 100644 --- a/js/src/vm/CodeCoverage.cpp +++ b/js/src/vm/CodeCoverage.cpp @@ -745,7 +745,9 @@ void CollectScriptCoverage(JSScript* script) { } LCovSource* source = p->value(); - source->writeScript(script); + if (!script->isUncompleted()) { + source->writeScript(script); + } map->remove(p); }