mirror of
https://github.com/chromium/crashpad.git
synced 2025-03-09 14:06:33 +00:00
In Annotation::SetSize, use AnnotationList::Register rather than Get.
In Chromium, the AnnotationList is registered in the main executable module. However, when using the component build, the individual shared libraries do not explicitly initialize the CrashpadInfo nor AnnotationList. This causes annotations to NULL-dereference the uninitialized AnnotationList when using the component build. By using the Register method instead, the AnnotationList will be lazily created. In Chromium's static/release build, the AnnotationList will still be initialized deterministically during startup. Bug: crashpad:192 Change-Id: I8599b52630f4d7608e5028b14264a8eed49a9176 Reviewed-on: https://chromium-review.googlesource.com/793981 Commit-Queue: Robert Sesek <rsesek@chromium.org> Reviewed-by: Mark Mentovai <mark@chromium.org>
This commit is contained in:
parent
0d05b0d59e
commit
af28b83eb7
@ -30,7 +30,9 @@ constexpr size_t Annotation::kValueMaxSize;
|
||||
void Annotation::SetSize(ValueSizeType size) {
|
||||
DCHECK_LT(size, kValueMaxSize);
|
||||
size_ = size;
|
||||
AnnotationList::Get()->Add(this);
|
||||
// Use Register() instead of Get() in case the calling module has not
|
||||
// explicitly initialized the annotation list, to avoid crashing.
|
||||
AnnotationList::Register()->Add(this);
|
||||
}
|
||||
|
||||
void Annotation::Clear() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user