diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2017-04-27 09:07:53 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2017-04-27 09:07:53 -0700 |
commit | b8263692a6f2865482abbc21eae5a4e5163ab725 (patch) | |
tree | b1b938d4a83cf2b420001c9188194a5800d12eb2 /032array.cc | |
parent | f6645643953eeb0a493d258759a4421505d13539 (diff) | |
download | mu-b8263692a6f2865482abbc21eae5a4e5163ab725.tar.gz |
3841
Use the real original instruction in error messages. Thanks Ella Couch.
Diffstat (limited to '032array.cc')
-rw-r--r-- | 032array.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/032array.cc b/032array.cc index b586f930..64264ef8 100644 --- a/032array.cc +++ b/032array.cc @@ -342,14 +342,14 @@ case INDEX: { int base_address = base.value; trace(9998, "run") << "base address is " << base_address << end(); if (base_address == 0) { - raise << maybe(current_recipe_name()) << "tried to access location 0 in '" << to_original_string(current_instruction()) << "'\n" << end(); + raise << maybe(current_recipe_name()) << "tried to access location 0 in '" << current_instruction().original_string << "'\n" << end(); break; } reagent/*copy*/ index = current_instruction().ingredients.at(1); // Update INDEX index in Run vector<double> index_val(read_memory(index)); if (index_val.at(0) < 0 || index_val.at(0) >= get_or_insert(Memory, base_address)) { - raise << maybe(current_recipe_name()) << "invalid index " << no_scientific(index_val.at(0)) << " in '" << to_original_string(current_instruction()) << "'\n" << end(); + raise << maybe(current_recipe_name()) << "invalid index " << no_scientific(index_val.at(0)) << " in '" << current_instruction().original_string << "'\n" << end(); break; } reagent/*local*/ element; @@ -532,14 +532,14 @@ case PUT_INDEX: { // Update PUT_INDEX base in Run int base_address = base.value; if (base_address == 0) { - raise << maybe(current_recipe_name()) << "tried to access location 0 in '" << to_original_string(current_instruction()) << "'\n" << end(); + raise << maybe(current_recipe_name()) << "tried to access location 0 in '" << current_instruction().original_string << "'\n" << end(); break; } reagent/*copy*/ index = current_instruction().ingredients.at(1); // Update PUT_INDEX index in Run vector<double> index_val(read_memory(index)); if (index_val.at(0) < 0 || index_val.at(0) >= get_or_insert(Memory, base_address)) { - raise << maybe(current_recipe_name()) << "invalid index " << no_scientific(index_val.at(0)) << " in '" << to_original_string(current_instruction()) << "'\n" << end(); + raise << maybe(current_recipe_name()) << "invalid index " << no_scientific(index_val.at(0)) << " in '" << current_instruction().original_string << "'\n" << end(); break; } int address = base_address + /*skip length*/1 + index_val.at(0)*size_of(array_element(base.type)); @@ -630,7 +630,7 @@ case LENGTH: { reagent/*copy*/ array = current_instruction().ingredients.at(0); // Update LENGTH array in Run if (array.value == 0) { - raise << maybe(current_recipe_name()) << "tried to access location 0 in '" << to_original_string(current_instruction()) << "'\n" << end(); + raise << maybe(current_recipe_name()) << "tried to access location 0 in '" << current_instruction().original_string << "'\n" << end(); break; } products.resize(1); |