likely bug due to missing braces in SetMemoryGCSliceTimePrefChangedCallback()

RESOLVED FIXED

Status

()

Core
DOM
RESOLVED FIXED
a year ago
a year ago

People

(Reporter: jesup, Unassigned)

Tracking

45 Branch
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

a year ago
This looks like the call is properly indented, but the if is missing braces that would include it -- thus it will get invoked even if the pref value was out-of-bounds (like -1).

** CID 1400471:  Control flow issues  (NESTING_INDENT_MISMATCH)
/dom/base/nsJSEnvironment.cpp: 2331 in SetMemoryGCSliceTimePrefChangedCallback(const char *, void *)()


________________________________________________________________________________________________________
*** CID 1400471:  Control flow issues  (NESTING_INDENT_MISMATCH)
/dom/base/nsJSEnvironment.cpp: 2331 in SetMemoryGCSliceTimePrefChangedCallback(const char *, void *)()
2325     SetMemoryGCSliceTimePrefChangedCallback(const char* aPrefName, void* aClosure)
2326     {
2327       int32_t pref = Preferences::GetInt(aPrefName, -1);
2328       // handle overflow and negative pref values
2329       if (pref > 0 && pref < 100000)
2330         sActiveIntersliceGCBudget = pref;
>>>     CID 1400471:  Control flow issues  (NESTING_INDENT_MISMATCH)
>>>     This  statement is indented to column 5, as if it were nested within the preceding parent statement, but it is not.
2331         JS_SetGCParameter(sContext, JSGC_SLICE_TIME_BUDGET, pref);
2332     }
2333     
2334     static void
2335     SetMemoryGCCompactingPrefChangedCallback(const char* aPrefName, void* aClosure)
2336     {
Status: NEW → RESOLVED
Last Resolved: a year ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.