Fix a bug in smi loop analysis.
Add a missing null check that can hit when the for-loop index is not a variable. Review URL: http://codereview.chromium.org/840002 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4101 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
parent
ef371f3f24
commit
463ab046fa
@ -1058,7 +1058,7 @@ Variable* AssignedVariablesAnalyzer::FindSmiLoopVariable(ForStatement* stmt) {
|
||||
|
||||
// We only deal with local variables.
|
||||
Variable* loop_var = init->target()->AsVariableProxy()->AsVariable();
|
||||
if (!loop_var->IsStackAllocated()) return NULL;
|
||||
if (loop_var == NULL || !loop_var->IsStackAllocated()) return NULL;
|
||||
|
||||
// The initial value has to be a smi.
|
||||
Literal* init_lit = init->value()->AsLiteral();
|
||||
|
Loading…
Reference in New Issue
Block a user