about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--036refcount.cc2
-rw-r--r--057immutable.cc5
-rw-r--r--html/036refcount.cc.html5
-rw-r--r--html/057immutable.cc.html8
4 files changed, 8 insertions, 12 deletions
diff --git a/036refcount.cc b/036refcount.cc
index ef4a2c40..6786c1bf 100644
--- a/036refcount.cc
+++ b/036refcount.cc
@@ -183,7 +183,7 @@ def main [
 +mem: incrementing refcount of 1000: 2 -> 3
 
 :(after "Write Memory in Successful MAYBE_CONVERT")
-// TODO: double-check data here as well
+// todo: double-check data here as well
 vector<double> data;
 for (int i = 0;  i < size_of(product);  ++i)
   data.push_back(get_or_insert(Memory, base_address+/*skip tag*/1+i));
diff --git a/057immutable.cc b/057immutable.cc
index 578b5f8a..ef7dc464 100644
--- a/057immutable.cc
+++ b/057immutable.cc
@@ -355,7 +355,7 @@ void check_immutable_ingredients(const recipe_ordinal r) {
     for (int i = 0;  i < SIZE(caller.steps);  ++i) {
       const instruction& inst = caller.steps.at(i);
       check_immutable_ingredient_in_instruction(inst, immutable_vars, current_ingredient.name, caller);
-      if (inst.operation == INDEX && inst.ingredients.at(1).name == current_ingredient.name) continue;
+      if (inst.operation == INDEX && SIZE(inst.ingredients) > 1 && inst.ingredients.at(1).name == current_ingredient.name) continue;
       update_aliases(inst, immutable_vars);
     }
   }
@@ -374,7 +374,7 @@ void update_aliases(const instruction& inst, set<reagent>& current_ingredient_an
       case INDEX:
       case MAYBE_CONVERT:
         // current_ingredient_indices can only have 0 or one value
-        if (!current_ingredient_indices.empty()) {
+        if (!current_ingredient_indices.empty() && !inst.products.empty()) {
           if (is_mu_address(inst.products.at(0)) || is_mu_container(inst.products.at(0)) || is_mu_exclusive_container(inst.products.at(0)))
             current_ingredient_and_aliases.insert(inst.products.at(0));
         }
@@ -402,7 +402,6 @@ set<int> scan_contained_in_product_indices(const instruction& inst, set<int>& in
   set<int> result;
   for (int i = 0;  i < SIZE(callee.products);  ++i) {
     const reagent& current_product = callee.products.at(i);
-    // TODO
     const string_tree* contained_in_name = property(current_product, "contained-in");
     if (contained_in_name && selected_ingredients.find(contained_in_name->value) != selected_ingredients.end())
       result.insert(i);
diff --git a/html/036refcount.cc.html b/html/036refcount.cc.html
index fb44f1f0..dda4e250 100644
--- a/html/036refcount.cc.html
+++ b/html/036refcount.cc.html
@@ -16,7 +16,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
 .Constant { color: #00a0a0; }
 .cSpecial { color: #008000; }
 .muRecipe { color: #ff8700; }
-.Todo { color: #000000; background-color: #ffff00; padding-bottom: 1px; }
+.SalientComment { color: #00ffff; }
 .Comment { color: #9090ff; }
 .Delimiter { color: #800080; }
 .Special { color: #c00000; }
@@ -24,7 +24,6 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
 .Normal { color: #eeeeee; background-color: #080808; padding-bottom: 1px; }
 .muData { color: #ffff00; }
 .Identifier { color: #c0a020; }
-.SalientComment { color: #00ffff; }
 -->
 </style>
 
@@ -221,7 +220,7 @@ update_any_refcounts<span class="Delimiter">(</span>element<span class="Delimite
 <span class="traceContains">+mem: incrementing refcount of 1000: 2 -&gt; 3</span>
 
 <span class="Delimiter">:(after &quot;Write Memory in Successful MAYBE_CONVERT&quot;)</span>
-<span class="Comment">// </span><span class="Todo">TODO</span><span class="Comment">: double-check data here as well</span>
+<span class="Comment">// todo: double-check data here as well</span>
 vector&lt;<span class="Normal">double</span>&gt; data<span class="Delimiter">;</span>
 <span class="Normal">for</span> <span class="Delimiter">(</span><span class="Normal">int</span> i = <span class="Constant">0</span><span class="Delimiter">;</span>  i &lt; size_of<span class="Delimiter">(</span>product<span class="Delimiter">);</span>  ++i<span class="Delimiter">)</span>
   data<span class="Delimiter">.</span>push_back<span class="Delimiter">(</span>get_or_insert<span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> base_address+<span class="Comment">/*</span><span class="Comment">skip tag</span><span class="Comment">*/</span><span class="Constant">1</span>+i<span class="Delimiter">));</span>
diff --git a/html/057immutable.cc.html b/html/057immutable.cc.html
index 34928ecb..262bcf6d 100644
--- a/html/057immutable.cc.html
+++ b/html/057immutable.cc.html
@@ -16,14 +16,13 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
 .Constant { color: #00a0a0; }
 .traceContains { color: #008000; }
 .muRecipe { color: #ff8700; }
-.Todo { color: #000000; background-color: #ffff00; padding-bottom: 1px; }
+.cSpecial { color: #008000; }
 .Comment { color: #9090ff; }
 .Delimiter { color: #800080; }
 .Special { color: #c00000; }
 .Identifier { color: #c0a020; }
 .Normal { color: #eeeeee; background-color: #080808; padding-bottom: 1px; }
 .muData { color: #ffff00; }
-.cSpecial { color: #008000; }
 -->
 </style>
 
@@ -392,7 +391,7 @@ Transform<span class="Delimiter">.</span>push_back<span class="Delimiter">(</spa
     <span class="Normal">for</span> <span class="Delimiter">(</span><span class="Normal">int</span> i = <span class="Constant">0</span><span class="Delimiter">;</span>  i &lt; SIZE<span class="Delimiter">(</span>caller<span class="Delimiter">.</span>steps<span class="Delimiter">);</span>  ++i<span class="Delimiter">)</span> <span class="Delimiter">{</span>
       <span class="Normal">const</span> instruction&amp; inst = caller<span class="Delimiter">.</span>steps<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">);</span>
       check_immutable_ingredient_in_instruction<span class="Delimiter">(</span>inst<span class="Delimiter">,</span> immutable_vars<span class="Delimiter">,</span> current_ingredient<span class="Delimiter">.</span>name<span class="Delimiter">,</span> caller<span class="Delimiter">);</span>
-      <span class="Normal">if</span> <span class="Delimiter">(</span>inst<span class="Delimiter">.</span>operation == INDEX &amp;&amp; inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">1</span><span class="Delimiter">).</span>name == current_ingredient<span class="Delimiter">.</span>name<span class="Delimiter">)</span> <span class="Identifier">continue</span><span class="Delimiter">;</span>
+      <span class="Normal">if</span> <span class="Delimiter">(</span>inst<span class="Delimiter">.</span>operation == INDEX &amp;&amp; SIZE<span class="Delimiter">(</span>inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">)</span> &gt; <span class="Constant">1</span> &amp;&amp; inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">1</span><span class="Delimiter">).</span>name == current_ingredient<span class="Delimiter">.</span>name<span class="Delimiter">)</span> <span class="Identifier">continue</span><span class="Delimiter">;</span>
       update_aliases<span class="Delimiter">(</span>inst<span class="Delimiter">,</span> immutable_vars<span class="Delimiter">);</span>
     <span class="Delimiter">}</span>
   <span class="Delimiter">}</span>
@@ -411,7 +410,7 @@ Transform<span class="Delimiter">.</span>push_back<span class="Delimiter">(</spa
       <span class="Normal">case</span> INDEX:
       <span class="Normal">case</span> MAYBE_CONVERT:
         <span class="Comment">// current_ingredient_indices can only have 0 or one value</span>
-        <span class="Normal">if</span> <span class="Delimiter">(</span>!current_ingredient_indices<span class="Delimiter">.</span>empty<span class="Delimiter">())</span> <span class="Delimiter">{</span>
+        <span class="Normal">if</span> <span class="Delimiter">(</span>!current_ingredient_indices<span class="Delimiter">.</span>empty<span class="Delimiter">()</span> &amp;&amp; !inst<span class="Delimiter">.</span>products<span class="Delimiter">.</span>empty<span class="Delimiter">())</span> <span class="Delimiter">{</span>
           <span class="Normal">if</span> <span class="Delimiter">(</span>is_mu_address<span class="Delimiter">(</span>inst<span class="Delimiter">.</span>products<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">))</span> || is_mu_container<span class="Delimiter">(</span>inst<span class="Delimiter">.</span>products<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">))</span> || is_mu_exclusive_container<span class="Delimiter">(</span>inst<span class="Delimiter">.</span>products<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">)))</span>
             current_ingredient_and_aliases<span class="Delimiter">.</span>insert<span class="Delimiter">(</span>inst<span class="Delimiter">.</span>products<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">));</span>
         <span class="Delimiter">}</span>
@@ -439,7 +438,6 @@ set&lt;<span class="Normal">int</span>&gt; scan_contained_in_product_indices<spa
   set&lt;<span class="Normal">int</span>&gt; result<span class="Delimiter">;</span>
   <span class="Normal">for</span> <span class="Delimiter">(</span><span class="Normal">int</span> i = <span class="Constant">0</span><span class="Delimiter">;</span>  i &lt; SIZE<span class="Delimiter">(</span>callee<span class="Delimiter">.</span>products<span class="Delimiter">);</span>  ++i<span class="Delimiter">)</span> <span class="Delimiter">{</span>
     <span class="Normal">const</span> reagent&amp; current_product = callee<span class="Delimiter">.</span>products<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">);</span>
-    <span class="Comment">// </span><span class="Todo">TODO</span>
     <span class="Normal">const</span> string_tree* contained_in_name = property<span class="Delimiter">(</span>current_product<span class="Delimiter">,</span> <span class="Constant">&quot;contained-in&quot;</span><span class="Delimiter">);</span>
     <span class="Normal">if</span> <span class="Delimiter">(</span>contained_in_name &amp;&amp; selected_ingredients<span class="Delimiter">.</span>find<span class="Delimiter">(</span>contained_in_name<span class="Delimiter">-&gt;</span>value<span class="Delimiter">)</span> != selected_ingredients<span class="Delimiter">.</span>end<span class="Delimiter">())</span>
       result<span class="Delimiter">.</span>insert<span class="Delimiter">(</span>i<span class="Delimiter">);</span>