about summary refs log tree commit diff stats
path: root/042name.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-12-27 18:09:30 -0800
committerKartik K. Agaram <vc@akkartik.com>2016-12-27 18:09:30 -0800
commitc792fe8ea24e1ba040474b672e7e219385b26569 (patch)
tree1446339321584ec2acf4c0db396d60f01eebf9a0 /042name.cc
parent5bdc0334730a22182739aea96b2257ed42282614 (diff)
downloadmu-c792fe8ea24e1ba040474b672e7e219385b26569.tar.gz
3723
Playing 5 why's with the previous commit, a better error message if we
somehow skip translating an offset in 'get'.
Diffstat (limited to '042name.cc')
-rw-r--r--042name.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/042name.cc b/042name.cc
index 9be2b4da..cae48c8a 100644
--- a/042name.cc
+++ b/042name.cc
@@ -229,6 +229,15 @@ $error: 0
 //:: Support element names for containers in 'get' and 'get-location' and 'put'.
 //: (get-location is implemented later)
 
+:(before "End update GET offset_value in Check")
+else {
+  if (!offset.initialized) {
+    raise << maybe(get(Recipe, r).name) << "uninitialized offset '" << offset.name << "' in '" << to_original_string(inst) << "'\n" << end();
+    break;
+  }
+  offset_value = offset.value;
+}
+
 :(scenario transform_names_transforms_container_elements)
 def main [
   p:&:point <- copy 0