From 944f4410e90209821fe6056d2b6cbb724be576c8 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Thu, 23 Jun 2016 08:20:53 -0700 Subject: 3064 - improve an error message --- 032array.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to '032array.cc') diff --git a/032array.cc b/032array.cc index 0f8ea6fe..9fe69b5c 100644 --- a/032array.cc +++ b/032array.cc @@ -221,7 +221,7 @@ case INDEX: { // Update INDEX index in Run vector 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)) << '\n' << end(); + raise << maybe(current_recipe_name()) << "invalid index " << no_scientific(index_val.at(0)) << " in '" << to_original_string(current_instruction()) << "'\n" << end(); break; } type_tree* element_type = copy_array_element(base.type); @@ -282,7 +282,7 @@ def main [ 7:number <- copy 16 index 1:array:number:3, 4 # less than size of array in locations, but larger than its length in elements ] -+error: main: invalid index 4 ++error: main: invalid index 4 in 'index 1:array:number:3, 4' :(scenario index_out_of_bounds_2) % Hide_errors = true; @@ -296,7 +296,7 @@ def main [ 7:number <- copy 16 index 1:array:point, -1 ] -+error: main: invalid index -1 ++error: main: invalid index -1 in 'index 1:array:point, -1' :(scenario index_product_type_mismatch) % Hide_errors = true; -- cgit 1.4.1-2-gfad0