https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=217200

            Bug ID: 217200
           Summary: std::make_shared does not perform zero initialization
           Product: Base System
           Version: 10.3-STABLE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: misc
          Assignee: [email protected]
          Reporter: [email protected]

>From https://bugs.llvm.org/show_bug.cgi?id=32002:

On FreeBSD 10.3, the following program displays "123", but "0" is expected:

#include <memory>
#include <iostream>

int main()
{
    std::make_shared<int>(123);
    std::cout << *std::make_shared<int>();
    return 0;
}

The second std::make_shared reuses the piece of memory of the first one. But it
should initialize it to zero, as if "new (ptr) int()" is called, where ptr is
the address of allocated memory.

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "[email protected]"

Reply via email to