Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-121547

PR78710 - suggest better exception text for stoi, stol, ...

Linking RHIVOS CVEs to...Migration: Automation ...Sync from "Extern...XMLWordPrintable

    • None
    • rhel-pt-cpp-libs
    • None
    • False
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • None
    • Unspecified
    • Unspecified
    • Unspecified
    • None

       

      Link to PR78710

      Background

      Nicolai Josuttis 2016-12-07 13:46:36 UTC
      stoi("hello") currently throws an exception where what() only outputs "stoi"
      (nothing else).

      The reason is (if I analyzed it correctly):

      • stoi etc. pass their name (just "stoi") to __stoa as __name
      • __stoa calls:
            std::_throw_invalid_argument(_name);
      • which usually seems to call _GLIBCXX_THROW_OR_ABORT

      Some component (either __stoa() or __throw_invalid_argument())
      should extend the message at least a bit.
      E.g. __stoa() might call
             std::__throw_invalid_argument("invalid argument for " + __name)
      (using a valid syntax of course).

              Unassigned Unassigned
              rh-ee-ralvaro Ricardo Alvaro
              Jonathan Wakely Jonathan Wakely
              Vaclav Kadlcik Vaclav Kadlcik
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated: