diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2015-08-02 22:18:19 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2015-08-02 22:18:19 -0700 |
commit | cfb142b9601cc648f15bf5738a3df09a23835e41 (patch) | |
tree | 670f168fbbf2693b17d679939bd1c203de1c3837 /020run.cc | |
parent | 37900254f083364dcfbb80cf7119c230a0b603d6 (diff) | |
download | mu-cfb142b9601cc648f15bf5738a3df09a23835e41.tar.gz |
1923
Still iterating on the right way to handle incorrect number of ingredients. My first idea of creating null results doesn't really work once they're used in later instructions. Just add a warning at one place in the run loop, but otherwise only add products when there's something to save in them. Undoes some work around commit 1886.
Diffstat (limited to '020run.cc')
-rw-r--r-- | 020run.cc | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/020run.cc b/020run.cc index 72fc2b7c..c981349f 100644 --- a/020run.cc +++ b/020run.cc @@ -88,10 +88,13 @@ void run_current_routine() cout << "not a primitive op: " << current_instruction().operation << '\n'; } } - if (SIZE(products) < SIZE(current_instruction().products)) + if (SIZE(products) < SIZE(current_instruction().products)) { raise << SIZE(products) << " vs " << SIZE(current_instruction().products) << ": failed to write to all products! " << current_instruction().to_string() << end(); - for (long long int i = 0; i < SIZE(current_instruction().products); ++i) { - write_memory(current_instruction().products.at(i), products.at(i)); + } + else { + for (long long int i = 0; i < SIZE(current_instruction().products); ++i) { + write_memory(current_instruction().products.at(i), products.at(i)); + } } // End of Instruction ++current_step_index(); |