From 7df0ea4ec45b33046a499f34388f389be91a0f67 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Wed, 24 Oct 2018 22:52:48 -0700 Subject: 4720 Raise an error when we fall off the end of the code segment. --- subx/012elf.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'subx/012elf.cc') diff --git a/subx/012elf.cc b/subx/012elf.cc index 2e10246e..28064a1e 100644 --- a/subx/012elf.cc +++ b/subx/012elf.cc @@ -12,8 +12,8 @@ if (is_equal(argv[1], "run")) { load_elf(argv[2], argc, argv); while (EIP < End_of_program) // weak final-gasp termination check run_one_instruction(); - trace(90, "load") << "executed past end of the world: " << EIP << " vs " << End_of_program << end(); - return 0; + raise << "executed past end of the world: " << EIP << " vs " << End_of_program << '\n' << end(); + return 1; } :(code) -- cgit 1.4.1-2-gfad0