Homec4science

Fix std::iscntrl use in gtest-printers.cc

Authored by Victor Costan <costan@gmail.com> on Feb 10 2018, 07:42.

Description

Fix std::iscntrl use in gtest-printers.cc

ContainsUnprintableControlCodes() in gtest-printers.cc passes a char
argument to std::iscntrl. Although its argument is an int, std::iscntrl
produces undefined behavior if its argument is not representable as an
unsigned char. The standard library on Windows asserts that the argument
is an unsigned char, resulting in an assertion crash on debug builds.

Details

Committed
Victor Costan <costan@gmail.com>Feb 12 2018, 22:02
Pushed
trottetDec 4 2019, 13:52
Parents
R9484:222607a01963: Merge pull request #1451 from gennadiycivil/master
Branches
Unknown
Tags
Unknown

Event Timeline

Victor Costan <costan@gmail.com> committed R9484:b3a1759eac70: Fix std::iscntrl use in gtest-printers.cc (authored by Victor Costan <costan@gmail.com>).Feb 12 2018, 22:02