|
From: <got...@us...> - 2009-10-12 12:16:50
|
Revision: 419
http://scstudio.svn.sourceforge.net/scstudio/?rev=419&view=rev
Author: gotthardp
Date: 2009-10-12 12:16:37 +0000 (Mon, 12 Oct 2009)
Log Message:
-----------
Fixed SIGSEGV when printing a disconnected time constraint.
Modified Paths:
--------------
trunk/src/data/Z120/z120_save.cpp
trunk/tests/checker_test.cpp
trunk/tests/z120_test/z120_test.cpp
Modified: trunk/src/data/Z120/z120_save.cpp
===================================================================
--- trunk/src/data/Z120/z120_save.cpp 2009-10-12 11:38:14 UTC (rev 418)
+++ trunk/src/data/Z120/z120_save.cpp 2009-10-12 12:16:37 UTC (rev 419)
@@ -508,6 +508,9 @@
else
stream << ",";
+ if((*rpos)->get_ref_node_b() == NULL)
+ throw std::invalid_argument("Disconnected time constraint.");
+
if((*rpos)->is_bottom_node_b())
stream << " bottom";
else
Modified: trunk/tests/checker_test.cpp
===================================================================
--- trunk/tests/checker_test.cpp 2009-10-12 11:38:14 UTC (rev 418)
+++ trunk/tests/checker_test.cpp 2009-10-12 12:16:37 UTC (rev 419)
@@ -159,7 +159,15 @@
else
std::cout << "OK: " << argv[3] << " violated " << argv[2] << ", should be violated" << std::endl;
- z120.save_msc(std::cout, L"counter_example", result);
+ try
+ {
+ z120.save_msc(std::cout, L"counter_example", result);
+ }
+ catch(std::exception& exc)
+ {
+ std::cerr << "EXCEPTION: Cannot save the document: " << exc.what() << std::endl;
+ errors = 1;
+ }
}
}
catch(std::exception &exc)
Modified: trunk/tests/z120_test/z120_test.cpp
===================================================================
--- trunk/tests/z120_test/z120_test.cpp 2009-10-12 11:38:14 UTC (rev 418)
+++ trunk/tests/z120_test/z120_test.cpp 2009-10-12 12:16:37 UTC (rev 419)
@@ -80,7 +80,15 @@
std::cout << std::endl;
- z120.save_msc(std::cout, TOWSTRING(filename), msc[0], msc);
+ try
+ {
+ z120.save_msc(std::cout, TOWSTRING(filename), msc[0], msc);
+ }
+ catch(std::exception& exc)
+ {
+ std::cerr << "EXCEPTION: Cannot save the document: " << exc.what() << std::endl;
+ errors = 1;
+ }
}
else
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|