Chromium Code Reviews| Index: src/platform.h |
| diff --git a/src/platform.h b/src/platform.h |
| index dbd638475a37d8477136f85b2acc2695dfde4bef..a297c47d07857f8b28663d375f262bfcab9c11ca 100644 |
| --- a/src/platform.h |
| +++ b/src/platform.h |
| @@ -481,9 +481,11 @@ class TickSample { |
| } |
| inline void InitStack(int depth) { |
| - stack = SmartPointer<Address>(NewArray<Address>(depth + 1)); |
| - // null-terminate |
| - stack[depth] = 0; |
| + if (depth) { |
| + stack = SmartPointer<Address>(NewArray<Address>(depth + 1)); |
| + // null-terminate |
| + stack[depth] = 0; |
| + } |
| } |
| }; |