WebKit Bugzilla
Attachment 342932 Details for
Bug 186763
: bmalloc: Coverity scan issues
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-186763-20180618160122.patch (text/plain), 2.59 KB, created by
Tomas Popela
on 2018-06-18 07:01:23 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Tomas Popela
Created:
2018-06-18 07:01:23 PDT
Size:
2.59 KB
patch
obsolete
>Subversion Revision: 232929 >diff --git a/Source/bmalloc/ChangeLog b/Source/bmalloc/ChangeLog >index 8b6caf2c57f800cd0f3572235b59b90a6b21e31b..82b9a65a63052c4755663ad58f2b5d4ae3a74620 100644 >--- a/Source/bmalloc/ChangeLog >+++ b/Source/bmalloc/ChangeLog >@@ -1,3 +1,17 @@ >+2018-06-18 Tomas Popela <tpopela@redhat.com> >+ >+ bmalloc: Coverity scan issues >+ https://bugs.webkit.org/show_bug.cgi?id=186763 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * bmalloc/DebugHeap.h: Initialize the m_pageSize variable. >+ * bmalloc/IsoTLS.cpp: >+ (bmalloc::IsoTLS::ensureEntries): Check the return value of >+ pthread_key_create return(). >+ * bmalloc/VMAllocate.h: >+ (bmalloc::vmPageSize): Correctly check the return value of sysconf(). >+ > 2018-06-09 Dan Bernstein <mitz@apple.com> > > [Xcode] Clean up and modernize some build setting definitions >diff --git a/Source/bmalloc/bmalloc/DebugHeap.h b/Source/bmalloc/bmalloc/DebugHeap.h >index 314b9c3d92d06cc0fc908947eccbecc912972d3b..0b16c3fde8bfdec0748f680ba86c74d3f819c6b8 100644 >--- a/Source/bmalloc/bmalloc/DebugHeap.h >+++ b/Source/bmalloc/bmalloc/DebugHeap.h >@@ -53,7 +53,7 @@ private: > #endif > > // This is the debug heap. We can use whatever data structures we like. It doesn't matter. >- size_t m_pageSize; >+ size_t m_pageSize { 0 }; > std::mutex m_lock; > std::unordered_map<void*, size_t> m_sizeMap; > }; >diff --git a/Source/bmalloc/bmalloc/IsoTLS.cpp b/Source/bmalloc/bmalloc/IsoTLS.cpp >index aca5bf0c9a84bf16b8740fe8c4f4b574d406b18b..c8173b03764164ebba8a9c8ecc95c6ca9ddb79c1 100644 >--- a/Source/bmalloc/bmalloc/IsoTLS.cpp >+++ b/Source/bmalloc/bmalloc/IsoTLS.cpp >@@ -68,7 +68,9 @@ IsoTLS* IsoTLS::ensureEntries(unsigned offset) > #if HAVE_PTHREAD_MACHDEP_H > pthread_key_init_np(tlsKey, destructor); > #else >- pthread_key_create(&s_tlsKey, destructor); >+ int error = pthread_key_create(&s_tlsKey, destructor); >+ if (error) >+ BCRASH(); > s_didInitialize = true; > #endif > }); >diff --git a/Source/bmalloc/bmalloc/VMAllocate.h b/Source/bmalloc/bmalloc/VMAllocate.h >index eb72f054cb9d9dc92458c31fc7220cf03ef7c727..ef2d63081d996d90a01d9fc4b387863d7f9915b7 100644 >--- a/Source/bmalloc/bmalloc/VMAllocate.h >+++ b/Source/bmalloc/bmalloc/VMAllocate.h >@@ -56,8 +56,10 @@ namespace bmalloc { > inline size_t vmPageSize() > { > static size_t cached; >- if (!cached) >- cached = sysconf(_SC_PAGESIZE); >+ if (!cached) { >+ long pageSize = sysconf(_SC_PAGESIZE); >+ cached = pageSize < 0 ? smallPageSize : pageSize; >+ } > return cached; > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 186763
:
342932
|
342942
|
343022
|
343032