Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 86 | 86 |
| 87 // Maximum table size is max_int. Within this limit it's easy to check | 87 // Maximum table size is max_int. Within this limit it's easy to check |
| 88 // for multiply overflow. Should we support bigger numbers? | 88 // for multiply overflow. Should we support bigger numbers? |
| 89 if (multiply > kMaxInt) { | 89 if (multiply > kMaxInt) { |
| 90 ThrowStringException("Too many lines: differencer table size is too big", | 90 ThrowStringException("Too many lines: differencer table size is too big", |
| 91 isolate); | 91 isolate); |
| 92 *has_exception = true; | 92 *has_exception = true; |
| 93 return; | 93 return; |
| 94 } | 94 } |
| 95 multiply *= sizeof(int); // NOLINT | 95 multiply *= sizeof(int); // NOLINT |
| 96 ASSERT(multiply >= 0); | |
|
Vyacheslav Egorov (Chromium)
2011/06/02 07:00:30
This compilation problem was reverted from svn.
| |
| 96 size_t size = multiply; | 97 size_t size = multiply; |
| 97 if (size != multiply) { | 98 if (static_cast<int64_t>(size) != multiply) { |
| 98 // Shouldn't be reachable. | 99 // Shouldn't be reachable. |
| 99 ThrowStringException( | 100 ThrowStringException( |
| 100 "Too many lines: " | 101 "Too many lines: " |
| 101 "differencer table buffer size doesn't fit into size_t", isolate); | 102 "differencer table buffer size doesn't fit into size_t", isolate); |
| 102 *has_exception = true; | 103 *has_exception = true; |
| 103 return; | 104 return; |
| 104 } | 105 } |
| 105 void* p = malloc(size); | 106 void* p = malloc(size); |
| 106 if (p == NULL) { | 107 if (p == NULL) { |
| 107 ThrowStringException( | 108 ThrowStringException( |
| (...skipping 1736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1844 | 1845 |
| 1845 bool LiveEditFunctionTracker::IsActive(Isolate* isolate) { | 1846 bool LiveEditFunctionTracker::IsActive(Isolate* isolate) { |
| 1846 return false; | 1847 return false; |
| 1847 } | 1848 } |
| 1848 | 1849 |
| 1849 #endif // ENABLE_DEBUGGER_SUPPORT | 1850 #endif // ENABLE_DEBUGGER_SUPPORT |
| 1850 | 1851 |
| 1851 | 1852 |
| 1852 | 1853 |
| 1853 } } // namespace v8::internal | 1854 } } // namespace v8::internal |
| OLD | NEW |