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

            Bug ID: 290687
           Summary: LIBCPP hardening asserts are enabled with -DNDEBUG
                    which degrades performance
           Product: Base System
           Version: 14.3-STABLE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: [email protected]
          Reporter: [email protected]

---BEGIN test program---
//#define _LIBCPP_HARDENING_MODE _LIBCPP_HARDENING_MODE_NONE 

#include <vector>
#include <iostream>


int main() {
        std::vector<int> v = {1, 2, 3, 4, 5};

        std::cout << "last-ptr=" << &v[5] << std::endl;

        return 0;
}
---END test program---

The above program fails with Illegal instruction due to LIBCPP asserts being
enabled.

Normally all asserts should be disabled with -DNDEBUG but these LIBCPP asserts
remain.

The hardening mode can be changed by uncommenting the first line in the
program.

_LIBCPP_HARDENING_MODE should probably default to _LIBCPP_HARDENING_MODE_NONE
with -DNDEBUG.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to