[Bug libstdc++/12791] _M_extract_num returns a wrong __beg in case of error

cvs-commit at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Wed Dec 3 09:17:00 GMT 2003


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2003-12-03 09:17 -------
Subject: Bug 12791

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	paolo@gcc.gnu.org	2003-12-03 09:17:22

Modified files:
	libstdc++-v3/include/bits: locale_facets.tcc 
	libstdc++-v3/testsuite/22_locale/time_get/get_date/wchar_t: 1.cc 
	libstdc++-v3/testsuite/22_locale/time_get/get_monthname/wchar_t: 
	                                                                 1.cc 
	libstdc++-v3/testsuite/22_locale/time_get/get_time/wchar_t: 1.cc 
	libstdc++-v3/testsuite/22_locale/time_get/get_year/wchar_t: 1.cc 
Added files:
	libstdc++-v3/testsuite/22_locale/time_get/get_date/char: 
	                                                         12791.cc 
	libstdc++-v3/testsuite/22_locale/time_get/get_date/wchar_t: 
	                                                            12791.cc 

Log message:
	2003-12-03  Paolo Carlini  <pcarlini@suse.de>
	
	PR libstdc++/12791
	* include/bits/locale_facets.tcc (time_get::_M_extract_num):
	Rewrite, stop the parsing as soon as a digit cannot possibly
	lead to a final number within the bounds; otherwise, simplify,
	avoiding __ctype.is() and atoi().
	* testsuite/22_locale/time_get/get_date/char/12791.cc: New.
	* testsuite/22_locale/time_get/get_date/wchar_t/12791.cc: New.
	
	* include/bits/locale_facets.tcc (time_get::_M_extract_via_format):
	Minor tweak: a 4-digit integer cannot be bigger than 9999.
	
	* testsuite/22_locale/time_get/get_date/wchar_t/1.cc: Use
	type-correct wchar_t string literals.
	* testsuite/22_locale/time_get/get_monthname/wchar_t/1.cc: Ditto.
	* testsuite/22_locale/time_get/get_time/wchar_t/1.cc: Ditto.
	* testsuite/22_locale/time_get/get_weekday/wchar_t/1.cc: Ditto.
	* testsuite/22_locale/time_get/get_year/wchar_t/1.cc: Ditto.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/include/bits/locale_facets.tcc.diff?cvsroot=gcc&r1=1.150&r2=1.151
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/22_locale/time_get/get_date/char/12791.cc.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/22_locale/time_get/get_date/wchar_t/12791.cc.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/22_locale/time_get/get_date/wchar_t/1.cc.diff?cvsroot=gcc&r1=1.4&r2=1.5
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/22_locale/time_get/get_monthname/wchar_t/1.cc.diff?cvsroot=gcc&r1=1.4&r2=1.5
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/22_locale/time_get/get_time/wchar_t/1.cc.diff?cvsroot=gcc&r1=1.4&r2=1.5
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/22_locale/time_get/get_year/wchar_t/1.cc.diff?cvsroot=gcc&r1=1.4&r2=1.5



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12791



More information about the Gcc-bugs mailing list