Title: [282405] trunk/Source/WTF
Revision
282405
Author
[email protected]
Date
2021-09-14 13:09:00 -0700 (Tue, 14 Sep 2021)

Log Message

StackTrace outputs a garbage prefix because WTF::StackTrace::m_prefix is filled with the stack content
https://bugs.webkit.org/show_bug.cgi?id=230207

Reviewed by Yusuke Suzuki.

r278474 (Bug 226390) added a new member m_prefix to StackTrace at
the bottom of the structure. However, StackTrace isn't a normal
structure. The members are filled with the stack content.

* wtf/StackTrace.h: Moved the m_prefix to the top of the members.

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (282404 => 282405)


--- trunk/Source/WTF/ChangeLog	2021-09-14 20:06:15 UTC (rev 282404)
+++ trunk/Source/WTF/ChangeLog	2021-09-14 20:09:00 UTC (rev 282405)
@@ -1,3 +1,16 @@
+2021-09-14  Fujii Hironori  <[email protected]>
+
+        StackTrace outputs a garbage prefix because WTF::StackTrace::m_prefix is filled with the stack content
+        https://bugs.webkit.org/show_bug.cgi?id=230207
+
+        Reviewed by Yusuke Suzuki.
+
+        r278474 (Bug 226390) added a new member m_prefix to StackTrace at
+        the bottom of the structure. However, StackTrace isn't a normal
+        structure. The members are filled with the stack content.
+
+        * wtf/StackTrace.h: Moved the m_prefix to the top of the members.
+
 2021-09-14  Kate Cheney  <[email protected]>
 
         Followup to https://bugs.webkit.org/show_bug.cgi?id=217784

Modified: trunk/Source/WTF/wtf/StackTrace.h (282404 => 282405)


--- trunk/Source/WTF/wtf/StackTrace.h	2021-09-14 20:06:15 UTC (rev 282404)
+++ trunk/Source/WTF/wtf/StackTrace.h	2021-09-14 20:09:00 UTC (rev 282405)
@@ -40,10 +40,10 @@
 
     // Borrowed stack trace.
     StackTrace(void** stack, int size, const char* prefix = "")
-        : m_size(size)
+        : m_prefix(prefix)
+        , m_size(size)
         , m_capacity(0)
         , m_borrowedStack(stack)
-        , m_prefix(prefix)
     { }
 
     int size() const { return m_size; }
@@ -82,6 +82,8 @@
         : m_size(0)
     { }
 
+    const char* m_prefix { nullptr };
+
     // We structure the top fields this way because the underlying stack capture
     // facility will capture from the top of the stack, and we'll need to skip the
     // top 2 frame which is of no interest. Setting up the fields layout this way
@@ -100,8 +102,6 @@
         void** m_borrowedStack;
         void* m_stack[1];
     };
-
-    const char* m_prefix;
 };
 
 } // namespace WTF
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to