[llvm-bugs] [Bug 35119] New: std::set_union accesses an element after it has been moved out.

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Oct 29 08:55:19 PDT 2017


https://bugs.llvm.org/show_bug.cgi?id=35119

            Bug ID: 35119
           Summary: std::set_union accesses an element after it has been
                    moved out.
           Product: libc++
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: All Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: denis.yaroshevskij at gmail.com
                CC: llvm-bugs at lists.llvm.org, mclow.lists at gmail.com

std::set_union has this code:

```
*__result = *__first1;

if (!__comp(*__first1, *__first2))
 ++__first2;
```

It's not ok, since the assignment might have moved the value out.

Suggested fix and test: https://reviews.llvm.org/D39405

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20171029/338ef2db/attachment.html>


More information about the llvm-bugs mailing list