OLD | NEW |
1 // Copyright 2014 The Crashpad Authors. All rights reserved. | 1 // Copyright 2014 The Crashpad Authors. All rights reserved. |
2 // | 2 // |
3 // Licensed under the Apache License, Version 2.0 (the "License"); | 3 // Licensed under the Apache License, Version 2.0 (the "License"); |
4 // you may not use this file except in compliance with the License. | 4 // you may not use this file except in compliance with the License. |
5 // You may obtain a copy of the License at | 5 // You may obtain a copy of the License at |
6 // | 6 // |
7 // http://www.apache.org/licenses/LICENSE-2.0 | 7 // http://www.apache.org/licenses/LICENSE-2.0 |
8 // | 8 // |
9 // Unless required by applicable law or agreed to in writing, software | 9 // Unless required by applicable law or agreed to in writing, software |
10 // distributed under the License is distributed on an "AS IS" BASIS, | 10 // distributed under the License is distributed on an "AS IS" BASIS, |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 if (!AssignIfInRange(&local_rva, local_offset)) { | 173 if (!AssignIfInRange(&local_rva, local_offset)) { |
174 LOG(ERROR) << "offset " << local_offset << " out of range"; | 174 LOG(ERROR) << "offset " << local_offset << " out of range"; |
175 return kInvalidSize; | 175 return kInvalidSize; |
176 } | 176 } |
177 | 177 |
178 for (RVA* rva : registered_rvas_) { | 178 for (RVA* rva : registered_rvas_) { |
179 *rva = local_rva; | 179 *rva = local_rva; |
180 } | 180 } |
181 | 181 |
182 if (!registered_location_descriptors_.empty()) { | 182 if (!registered_location_descriptors_.empty()) { |
183 typeof(registered_location_descriptors_[0]->DataSize) local_size; | 183 decltype(registered_location_descriptors_[0]->DataSize) local_size; |
184 if (!AssignIfInRange(&local_size, size)) { | 184 if (!AssignIfInRange(&local_size, size)) { |
185 LOG(ERROR) << "size " << size << " out of range"; | 185 LOG(ERROR) << "size " << size << " out of range"; |
186 return kInvalidSize; | 186 return kInvalidSize; |
187 } | 187 } |
188 | 188 |
189 for (MINIDUMP_LOCATION_DESCRIPTOR* location_descriptor : | 189 for (MINIDUMP_LOCATION_DESCRIPTOR* location_descriptor : |
190 registered_location_descriptors_) { | 190 registered_location_descriptors_) { |
191 location_descriptor->DataSize = local_size; | 191 location_descriptor->DataSize = local_size; |
192 location_descriptor->Rva = local_rva; | 192 location_descriptor->Rva = local_rva; |
193 } | 193 } |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 if (!WriteObject(file_writer)) { | 260 if (!WriteObject(file_writer)) { |
261 return false; | 261 return false; |
262 } | 262 } |
263 | 263 |
264 state_ = kStateWritten; | 264 state_ = kStateWritten; |
265 return true; | 265 return true; |
266 } | 266 } |
267 | 267 |
268 } // namespace internal | 268 } // namespace internal |
269 } // namespace crashpad | 269 } // namespace crashpad |
OLD | NEW |