Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1213)

Unified Diff: snapshot/mac/mach_o_image_annotations_reader_test.cc

Issue 989713002: snapshot/mac: MachOImageAnnotationsReader test shouldn’t crash with a nullptr ProcessReader::Module (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | snapshot/mac/process_reader.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: snapshot/mac/mach_o_image_annotations_reader_test.cc
diff --git a/snapshot/mac/mach_o_image_annotations_reader_test.cc b/snapshot/mac/mach_o_image_annotations_reader_test.cc
index 1978d38632c212fc512e1e6e6977df4179d52ec0..7006604a7bf132dfa59e996a9e96e8a5a3789a9b 100644
--- a/snapshot/mac/mach_o_image_annotations_reader_test.cc
+++ b/snapshot/mac/mach_o_image_annotations_reader_test.cc
@@ -98,13 +98,17 @@ class TestMachOImageAnnotationsReader final
process_reader.Modules();
std::vector<std::string> all_annotations_vector;
for (const ProcessReader::Module& module : modules) {
- MachOImageAnnotationsReader module_annotations_reader(
- &process_reader, module.reader, module.name);
- std::vector<std::string> module_annotations_vector =
- module_annotations_reader.Vector();
- all_annotations_vector.insert(all_annotations_vector.end(),
- module_annotations_vector.begin(),
- module_annotations_vector.end());
+ if (module.reader) {
+ MachOImageAnnotationsReader module_annotations_reader(
+ &process_reader, module.reader, module.name);
+ std::vector<std::string> module_annotations_vector =
+ module_annotations_reader.Vector();
+ all_annotations_vector.insert(all_annotations_vector.end(),
+ module_annotations_vector.begin(),
+ module_annotations_vector.end());
+ } else {
+ EXPECT_TRUE(module.reader);
+ }
}
// Mac OS X 10.6 doesn’t have support for CrashReporter annotations
« no previous file with comments | « no previous file | snapshot/mac/process_reader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698