diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2015-04-16 16:28:16 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2015-04-16 16:28:16 -0700 |
commit | 5ee4f1c95237f9794b151cd8fadea7f6e4a8d554 (patch) | |
tree | 891e5b89452d0f620456c2608a1c1d2e2b40a795 /cpp | |
parent | db5c9550e972d114aaabb95b14cfd1e3ea185349 (diff) | |
download | mu-5ee4f1c95237f9794b151cd8fadea7f6e4a8d554.tar.gz |
1070
Diffstat (limited to 'cpp')
-rw-r--r-- | cpp/030length | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/cpp/030length b/cpp/030length index 7b5c52be..b9e3bc3c 100644 --- a/cpp/030length +++ b/cpp/030length @@ -18,6 +18,10 @@ Next_recipe_number++; :(before "End Primitive Recipe Implementations") case LENGTH: { reagent x = canonize(instructions[pc].ingredients[0]); + if (x.types[0] != Type_number["array"]) { + raise << "tried to calculate length of non-array " << x.to_string() << '\n'; + break; + } vector<int> result; //? cout << "length: " << x.value << '\n'; //? 1 result.push_back(Memory[x.value]); |