From f547784a649a9dc5ca1d82022b377571ecc2d657 Mon Sep 17 00:00:00 2001 From: Steve Fink Date: Mon, 30 Mar 2015 14:01:58 -0700 Subject: [PATCH] Bug 963738 - Assume(ptr) is not a hazard; Assume(*ptr) is, r=bhackett --HG-- extra : rebase_source : c4e984a70ce093717810843b2243a4b0b5ab6a87 --- js/src/devtools/rootAnalysis/analyzeRoots.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/js/src/devtools/rootAnalysis/analyzeRoots.js b/js/src/devtools/rootAnalysis/analyzeRoots.js index 03d1db70cfd21..9e870a967bf39 100644 --- a/js/src/devtools/rootAnalysis/analyzeRoots.js +++ b/js/src/devtools/rootAnalysis/analyzeRoots.js @@ -93,6 +93,21 @@ function expressionUsesVariable(exp, variable) return false; } +function expressionUsesVariableContents(exp, variable) +{ + if (!("Exp" in exp)) + return false; + for (var childExp of exp.Exp) { + if (childExp.Kind == 'Drf') { + if (expressionUsesVariable(childExp, variable)) + return true; + } else if (expressionUsesVariableContents(childExp, variable)) { + return true; + } + } + return false; +} + // Detect simple |return nullptr;| statements. function isReturningImmobileValue(edge, variable) { @@ -136,7 +151,7 @@ function edgeUsesVariable(edge, variable, body) return expressionUsesVariable(edge.Exp[1], variable) ? src : 0; case "Assume": - return expressionUsesVariable(edge.Exp[0], variable) ? src : 0; + return expressionUsesVariableContents(edge.Exp[0], variable) ? src : 0; case "Call": if (expressionUsesVariable(edge.Exp[0], variable))