SourceForge: k3d/k3d: changeset 2649:5406e5d48061
BUG: serializing k3d::selection::type caused an infinite loop.
authorTimothy M. Shead <tshead@k-3d.com>
Mon Nov 02 20:45:34 2009 -0700 (3 weeks ago)
changeset 26495406e5d48061
parent 2648295b0b18a2bd
child 2650dcef4d4796a1
BUG: serializing k3d::selection::type caused an infinite loop.
k3dsdk/selection.cpp
k3dsdk/tests/selection_serialization.cpp
     1.1 --- a/k3dsdk/selection.cpp	Sat Oct 24 16:14:29 2009 -0600
     1.2 +++ b/k3dsdk/selection.cpp	Mon Nov 02 20:45:34 2009 -0700
     1.3 @@ -85,7 +85,8 @@
     1.4  			Stream << "vertex";
     1.5  			break;
     1.6  		default:
     1.7 -			Stream << RHS;
     1.8 +			// Note: we coerce the type here to prevent an infinite loop!
     1.9 +			log() << error << k3d_file_reference << ": unknown selection type: " << int(RHS) << std::endl;
    1.10  			break;
    1.11  	}
    1.12  
     2.1 --- a/k3dsdk/tests/selection_serialization.cpp	Sat Oct 24 16:14:29 2009 -0600
     2.2 +++ b/k3dsdk/tests/selection_serialization.cpp	Mon Nov 02 20:45:34 2009 -0700
     2.3 @@ -47,6 +47,8 @@
     2.4  {
     2.5  	try
     2.6  	{
     2.7 +		const k3d::string_t type_string = k3d::string_cast(static_cast<k3d::selection::type>(-1));
     2.8 +
     2.9  		k3d::selection::set a;
    2.10  		k3d::selection::storage& points = a.create("points");
    2.11  		k3d::uint_t_array& begin = points.structure.create<k3d::uint_t_array>("begin");