Commit 3a281115 authored by Benoit Perrot's avatar Benoit Perrot
Browse files

Manage main label not found

parent b24822d9
2003-06-29 Benot Perrot <benoit@lrde.epita.fr>
* src/vm/virtual_machine.hh: Display a dedicated error message
when the main label can not be found.
2003-06-29 Benot Perrot <benoit@lrde.epita.fr> 2003-06-29 Benot Perrot <benoit@lrde.epita.fr>
* dev/mipsy.xml, dev/mipsy.py: * dev/mipsy.xml, dev/mipsy.py:
......
...@@ -53,8 +53,13 @@ namespace vm ...@@ -53,8 +53,13 @@ namespace vm
precondition(_program); precondition(_program);
const inst::TextSection& text_section = (*_program).text_section (); const inst::TextSection& text_section = (*_program).text_section ();
if (! text_section.has_label(inst::Label("main")))
{
std::cerr << "No `main' label in assembly file." << std::endl;
return;
}
cpu.set_pc(text_section.get_offset(inst::Label("main"))); cpu.set_pc(text_section.get_offset(inst::Label("main")));
_halt = false; _halt = false;
while (!_halt) while (!_halt)
{ {
......
Supports Markdown
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