Commit 446f620b authored by Benoit Perrot's avatar Benoit Perrot
Browse files

* src/vm/virtual_machine.cc:

        Set exit_status to exit_runtime when an exception occurs.
parent 9fd8730e
2003-07-11 Benot Perrot <benoit@lrde.epita.fr>
* src/vm/virtual_machine.cc:
Set exit_status to exit_runtime when an exception occurs.
2003-07-11 Benot Perrot <benoit@lrde.epita.fr>
* src/vm/virtual_machine.hh, src/vm/virtual_machine.cc:
......
......@@ -16,6 +16,8 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
#include "common.hh"
#include "vm/virtual_machine.hh"
#include "inst/all.hh"
......@@ -39,7 +41,10 @@ namespace vm
// FIXME: might be accelerated by testing only the sign bit.
if ((a < 0 && b < 0 && c > 0) ||
(a > 0 && b > 0 && c < 0))
std::cerr << "Runtime Exception: Overflow" << std::endl;
{
std::cerr << "Runtime Exception: Overflow" << std::endl;
exit_set(exit_runtime);
}
}
void
VirtualMachine::visit(const inst::Addi& addi)
......@@ -53,7 +58,10 @@ namespace vm
// FIXME: might be accelerated by testing only the sign bit.
if ((a < 0 && b < 0 && c > 0) ||
(a > 0 && b > 0 && c < 0))
std::cerr << "Runtime Exception: Overflow" << std::endl;
{
std::cerr << "Runtime Exception: Overflow" << std::endl;
exit_set(exit_runtime);
}
}
void
VirtualMachine::visit(const inst::Addu& addu)
......@@ -79,7 +87,10 @@ namespace vm
cpu.set_register(sub.get_dest (), c);
if ((a < b && c > 0) || (a > b && c < 0))
std::cerr << "Runtime Exception: Overflow" << std::endl;
{
std::cerr << "Runtime Exception: Overflow" << std::endl;
exit_set(exit_runtime);
}
}
void
VirtualMachine::visit(const inst::Subu& subu)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment