Skip to content

Commit

Permalink
Bug 963738 - Assume(ptr) is not a hazard; Assume(*ptr) is, r=bhackett
Browse files Browse the repository at this point in the history
--HG--
extra : rebase_source : c4e984a70ce093717810843b2243a4b0b5ab6a87
  • Loading branch information
hotsphink committed Mar 30, 2015
1 parent e30ca0a commit f547784
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion js/src/devtools/rootAnalysis/analyzeRoots.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit f547784

Please sign in to comment.