File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -349,7 +349,12 @@ static unsigned int encodeMultiChar(const std::string& str)
349349MathLib::bigint MathLib::characterLiteralToLongNumber (const std::string& str)
350350{
351351 if (str.empty ())
352- return 0 ; // for unit-testing...
352+ return 0 ; // <- only possible in unit testing
353+
354+ // '\xF6'
355+ if (str.size () == 4 && str.compare (0 ,2 ," \\ x" )==0 && std::isxdigit (str[2 ]) && std::isxdigit (str[3 ])) {
356+ return std::strtoul (str.substr (2 ).c_str (), NULL , 16 );
357+ }
353358
354359 // C99 6.4.4.4
355360 // The value of an integer character constant containing more than one character (e.g., 'ab'),
Original file line number Diff line number Diff line change @@ -292,6 +292,7 @@ class TestMathLib : public TestFixture {
292292 ASSERT_EQUALS ((int )(' \3 ' ), MathLib::toLongNumber (" '\\ 3'" ));
293293 ASSERT_EQUALS ((int )(' \34 ' ), MathLib::toLongNumber (" '\\ 34'" ));
294294 ASSERT_EQUALS ((int )(' \034 ' ), MathLib::toLongNumber (" '\\ 034'" ));
295+ ASSERT_EQUALS ((int )(' \x34 ' ), MathLib::toLongNumber (" '\\ x34'" ));
295296 ASSERT_EQUALS ((int )(' \134 ' ), MathLib::toLongNumber (" '\\ 134'" ));
296297 ASSERT_EQUALS ((int )(' \134 t' ), MathLib::toLongNumber (" '\\ 134t'" )); // Ticket #7452
297298 ASSERT_THROW (MathLib::toLongNumber (" '\\ 9'" ), InternalError);
You can’t perform that action at this time.
0 commit comments