[Lldb-commits] [PATCH] D105832: [vscode] fix ubsan problem in the progress event reporter

walter erquinigo via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Jul 12 11:48:51 PDT 2021


wallace created this revision.
wallace added a reviewer: clayborg.
wallace requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

The error

UndefinedBehaviorSanitizer: undefined-behavior /Users/buildslave/jenkins/workspace/lldb-cmake-sanitized/llvm-project/lldb/tools/lldb-vscode/ProgressEvent.cpp:89:64 in

was found in https://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake-sanitized/1910/consoleFull#-15641370498254eaf0-7326-4999-85b0-388101f2d404

It turns out that we were not setting m_event_type when initializatin
and update case. The fix is very simple.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D105832

Files:
  lldb/tools/lldb-vscode/ProgressEvent.cpp


Index: lldb/tools/lldb-vscode/ProgressEvent.cpp
===================================================================
--- lldb/tools/lldb-vscode/ProgressEvent.cpp
+++ lldb/tools/lldb-vscode/ProgressEvent.cpp
@@ -47,6 +47,7 @@
       m_percentage = 100;
   } else {
     // Update event
+    m_event_type = progressUpdate;
     m_percentage = std::min(
         (uint32_t)((double)completed / (double)total * 100.0), (uint32_t)99);
     if (prev_event->Reported()) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D105832.358012.patch
Type: text/x-patch
Size: 464 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20210712/32f9cba1/attachment-0001.bin>


More information about the lldb-commits mailing list