OLD | NEW |
1 // Copyright (c) 2010 Google Inc. | 1 // Copyright (c) 2010 Google Inc. |
2 // All rights reserved. | 2 // All rights reserved. |
3 // | 3 // |
4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
6 // met: | 6 // met: |
7 // | 7 // |
8 // * Redistributions of source code must retain the above copyright | 8 // * Redistributions of source code must retain the above copyright |
9 // notice, this list of conditions and the following disclaimer. | 9 // notice, this list of conditions and the following disclaimer. |
10 // * Redistributions in binary form must reproduce the above | 10 // * Redistributions in binary form must reproduce the above |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 #include "processor/logging.h" | 43 #include "processor/logging.h" |
44 | 44 |
45 | 45 |
46 namespace google_breakpad { | 46 namespace google_breakpad { |
47 | 47 |
48 | 48 |
49 template<typename AddressType, typename EntryType> | 49 template<typename AddressType, typename EntryType> |
50 bool RangeMap<AddressType, EntryType>::StoreRange(const AddressType &base, | 50 bool RangeMap<AddressType, EntryType>::StoreRange(const AddressType &base, |
51 const AddressType &size, | 51 const AddressType &size, |
52 const EntryType &entry) { | 52 const EntryType &entry) { |
53 AddressType high = base + size - 1; | 53 AddressType high = base + (size - 1); |
54 | 54 |
55 // Check for undersize or overflow. | 55 // Check for undersize or overflow. |
56 if (size <= 0 || high < base) { | 56 if (size <= 0 || high < base) { |
57 // The processor will hit this case too frequently with common symbol | 57 // The processor will hit this case too frequently with common symbol |
58 // files in the size == 0 case, which is more suited to a DEBUG channel. | 58 // files in the size == 0 case, which is more suited to a DEBUG channel. |
59 // Filter those out since there's no DEBUG channel at the moment. | 59 // Filter those out since there's no DEBUG channel at the moment. |
60 BPLOG_IF(INFO, size != 0) << "StoreRange failed, " << HexString(base) << | 60 BPLOG_IF(INFO, size != 0) << "StoreRange failed, " << HexString(base) << |
61 "+" << HexString(size) << ", " << | 61 "+" << HexString(size) << ", " << |
62 HexString(high); | 62 HexString(high); |
63 return false; | 63 return false; |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 template<typename AddressType, typename EntryType> | 211 template<typename AddressType, typename EntryType> |
212 void RangeMap<AddressType, EntryType>::Clear() { | 212 void RangeMap<AddressType, EntryType>::Clear() { |
213 map_.clear(); | 213 map_.clear(); |
214 } | 214 } |
215 | 215 |
216 | 216 |
217 } // namespace google_breakpad | 217 } // namespace google_breakpad |
218 | 218 |
219 | 219 |
220 #endif // PROCESSOR_RANGE_MAP_INL_H__ | 220 #endif // PROCESSOR_RANGE_MAP_INL_H__ |
OLD | NEW |