Index: src/compiler/structured-machine-assembler.cc |
diff --git a/src/compiler/structured-machine-assembler.cc b/src/compiler/structured-machine-assembler.cc |
index 6475809e0e8e2c0f52b77cf27000f593b870a712..432b84c64a9e8e89ed0a39e870efffbba97c0919 100644 |
--- a/src/compiler/structured-machine-assembler.cc |
+++ b/src/compiler/structured-machine-assembler.cc |
@@ -213,8 +213,7 @@ void StructuredMachineAssembler::Merge(EnvironmentVector* environments, |
vars.reserve(n_vars); |
Node** scratch = NULL; |
size_t n_envs = environments->size(); |
- Environment** live_environments = reinterpret_cast<Environment**>( |
- alloca(sizeof(environments->at(0)) * n_envs)); |
+ Environment** live_environments = zone()->NewArray<Environment*>(n_envs); |
size_t n_live = 0; |
for (size_t i = 0; i < n_envs; i++) { |
if (environments->at(i)->is_dead_) continue; |
@@ -250,7 +249,7 @@ void StructuredMachineAssembler::Merge(EnvironmentVector* environments, |
CHECK(resolved != NULL); |
// Init scratch buffer. |
if (scratch == NULL) { |
- scratch = static_cast<Node**>(alloca(n_envs * sizeof(resolved))); |
+ scratch = zone()->NewArray<Node*>(n_envs); |
} |
for (size_t k = 0; k < i; k++) { |
scratch[k] = resolved; |