about summary refs log tree commit diff stats
path: root/030container.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-07-09 20:32:23 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-07-09 20:32:23 -0700
commit19323e7afc4b6c4da04c62ecaf05eb3768cacd93 (patch)
tree9ec2437b5194642bb454c06a19a89a159c313e5f /030container.cc
parentdfe0e4d4a5f768d427b9d0284db12300b2b01458 (diff)
downloadmu-19323e7afc4b6c4da04c62ecaf05eb3768cacd93.tar.gz
1744 - support just two editors rather than a list
Current model: you click on something to put it on the editor at the top
of the column. Worth a shot.
Diffstat (limited to '030container.cc')
-rw-r--r--030container.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/030container.cc b/030container.cc
index a679626e..4b013450 100644
--- a/030container.cc
+++ b/030container.cc
@@ -112,6 +112,8 @@ case GET: {
   assert(is_literal(current_instruction().ingredients.at(1)));
   assert(scalar(ingredients.at(1)));
   long long int offset = ingredients.at(1).at(0);
+  assert(offset >= 0);
+  assert(offset < size_of(base));
   long long int src = base_address;
   for (long long int i = 0; i < offset; ++i) {
     src += size_of(Type[base_type].elements.at(i));
@@ -161,6 +163,8 @@ case GET_ADDRESS: {
   assert(is_literal(current_instruction().ingredients.at(1)));
   assert(scalar(ingredients.at(1)));
   long long int offset = ingredients.at(1).at(0);
+  assert(offset >= 0);
+  assert(offset < size_of(base));
   long long int result = base_address;
   for (long long int i = 0; i < offset; ++i) {
     result += size_of(Type[base_type].elements.at(i));