diff --git a/xpcom/analysis/outparams.js b/xpcom/analysis/outparams.js index 48a1c23bc8d2..c7d8f8152e8e 100644 --- a/xpcom/analysis/outparams.js +++ b/xpcom/analysis/outparams.js @@ -455,7 +455,7 @@ OutparamCheck.prototype.processCall = function(dest, expr, blame, state) { // considered no-fail. state.update(function(ss) { for each (let [vbl, sem] in updates) { - if (sem == ps.OUTNOFAIL) { + if (sem == ps.OUTNOFAIL || sem == ps.OUTNOFAILNOCHECK) { ss.assignValue(vbl, av.WRITTEN, blame); return [ss]; } else { @@ -644,6 +644,10 @@ OutparamCheck.prototype.logResult = function(rv, msg, kind) { // checked by this analysis let ps = { OUTNOFAIL: { label: 'out-no-fail', val: av.WRITTEN, check: true }, + // Special value for receiver of strings methods. Callers should + // consider this to be an outparam (i.e., it modifies the string), + // but we don't want to check the method itself. + OUTNOFAILNOCHECK: { label: 'out-no-fail-no-check' }, OUT: { label: 'out', val: av.WRITTEN, check: true }, INOUT: { label: 'inout', val: av.WRITTEN, check: true }, MAYBE: { label: 'maybe', val: av.MAYBE_WRITTEN}, // maybe out @@ -680,7 +684,8 @@ OutparamCheck.prototype.func_param_semantics = function(callable) { let sem; if (i == 0 && string_mutator) { // Special case: string mutator receiver is an no-fail outparams - sem = ps.OUTNOFAIL; + // but not checkable + sem = ps.OUTNOFAILNOCHECK; } else { if (params) sem = decode_attr(DECL_ATTRIBUTES(params[i])); if (TRACE_CALL_SEM >= 2) print("param " + i + ": annotated " + sem);