about summary refs log tree commit diff stats
path: root/027trace.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-07-25 14:19:28 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-07-25 17:14:58 -0700
commite46306432ddb75a89f69d92ccc175a23f0b72072 (patch)
tree48ed3828064f29cefaf14e3fe61d7dc02cac0e80 /027trace.cc
parente83602d3917eba137cd8fb37605076fff5a746b1 (diff)
downloadmu-e46306432ddb75a89f69d92ccc175a23f0b72072.tar.gz
1848 - core instructions now check for ingredients
Also standardized warnings.
Diffstat (limited to '027trace.cc')
-rw-r--r--027trace.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/027trace.cc b/027trace.cc
index 12cc7ca3..742432fa 100644
--- a/027trace.cc
+++ b/027trace.cc
@@ -12,6 +12,10 @@ TRACE,
 Recipe_ordinal["trace"] = TRACE;
 :(before "End Primitive Recipe Implementations")
 case TRACE: {
+  if (SIZE(ingredients) != 2) {
+    raise << current_recipe_name() << ": 'trace' takes exactly two ingredients rather than '" << current_instruction().to_string() << "'\n" << end();
+    break;
+  }
   assert(is_literal(current_instruction().ingredients.at(0)));
   string label = current_instruction().ingredients.at(0).name;
   assert(is_literal(current_instruction().ingredients.at(1)));