Bug 1516138 - Check GC zeal mode is in range. r=allstars.chh, a=NPOTB
authorJon Coppeard <jcoppeard@mozilla.com>
Wed, 02 Jan 2019 18:19:01 +0000
changeset 509276 6ec9d5db308ead94198ed2f9e3cc9dc4c3546234
parent 509275 0ed7bf6707553ca54c207c96c9ad814ad0bb8096
child 509277 2ec4c1f9e95d51e1f356151e57b1ae47224c48c7
push id1905
push userffxbld-merge
push dateMon, 21 Jan 2019 12:33:13 +0000
treeherdermozilla-release@c2fca1944d8c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersallstars, NPOTB
bugs1516138
milestone65.0
Bug 1516138 - Check GC zeal mode is in range. r=allstars.chh, a=NPOTB
js/src/gc/GC.cpp
--- a/js/src/gc/GC.cpp
+++ b/js/src/gc/GC.cpp
@@ -1200,17 +1200,18 @@ bool GCRuntime::parseAndSetZeal(const ch
   CharRangeVector modes;
   if (!SplitStringBy(parts[0], ';', &modes)) {
     return false;
   }
 
   for (const auto& descr : modes) {
     uint32_t mode;
     if (!ParseZealModeName(descr, &mode) &&
-        !ParseZealModeNumericParam(descr, &mode)) {
+        !(ParseZealModeNumericParam(descr, &mode) &&
+          mode <= unsigned(ZealMode::Limit))) {
       return PrintZealHelpAndFail();
     }
 
     setZeal(mode, frequency);
   }
 
   return true;
 }