diff options
author | Kartik Agaram <vc@akkartik.com> | 2019-02-25 00:26:48 -0800 |
---|---|---|
committer | Kartik Agaram <vc@akkartik.com> | 2019-02-25 01:50:53 -0800 |
commit | cb7b403210f13e721739d58dab9000ec51ed2d0a (patch) | |
tree | e8f56c9e5577f82127d158d683faab84041ff0d8 /html/subx/032check_operand_bounds.cc.html | |
parent | 565dcbab944d0182a8e41c47c9dba38ca72e75b1 (diff) | |
download | mu-cb7b403210f13e721739d58dab9000ec51ed2d0a.tar.gz |
4989
Diffstat (limited to 'html/subx/032check_operand_bounds.cc.html')
-rw-r--r-- | html/subx/032check_operand_bounds.cc.html | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/html/subx/032check_operand_bounds.cc.html b/html/subx/032check_operand_bounds.cc.html index a96c4241..e7352f68 100644 --- a/html/subx/032check_operand_bounds.cc.html +++ b/html/subx/032check_operand_bounds.cc.html @@ -86,15 +86,15 @@ if ('onhashchange' in window) { <span id="L24" class="LineNr">24 </span> <span id="L25" class="LineNr">25 </span><span class="Delimiter">:(before "Pack Operands(segment code)")</span> <span id="L26" class="LineNr">26 </span>check_operand_bounds<span class="Delimiter">(</span><a href='031check_operands.cc.html#L11'>code</a><span class="Delimiter">);</span> -<span id="L27" class="LineNr">27 </span><span class="Normal">if</span> <span class="Delimiter">(</span><a href='003trace.cc.html#L204'>trace_contains_errors</a><span class="Delimiter">())</span> <span class="Identifier">return</span><span class="Delimiter">;</span> +<span id="L27" class="LineNr">27 </span><span class="Normal">if</span> <span class="Delimiter">(</span><a href='003trace.cc.html#L230'>trace_contains_errors</a><span class="Delimiter">())</span> <span class="Identifier">return</span><span class="Delimiter">;</span> <span id="L28" class="LineNr">28 </span><span class="Delimiter">:(code)</span> <span id="L29" class="LineNr">29 </span><span class="Normal">void</span> check_operand_bounds<span class="Delimiter">(</span><span class="Normal">const</span> segment& <a href='031check_operands.cc.html#L11'>code</a><span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L30" class="LineNr">30 </span> <a href='003trace.cc.html#L183'>trace</a><span class="Delimiter">(</span><span class="Constant">99</span><span class="Delimiter">,</span> <span class="Constant">"transform"</span><span class="Delimiter">)</span> << <span class="Constant">"-- check operand bounds"</span> << end<span class="Delimiter">();</span> +<span id="L30" class="LineNr">30 </span> <a href='003trace.cc.html#L98'>trace</a><span class="Delimiter">(</span><span class="Constant">3</span><span class="Delimiter">,</span> <span class="Constant">"transform"</span><span class="Delimiter">)</span> << <span class="Constant">"-- check operand bounds"</span> << end<span class="Delimiter">();</span> <span id="L31" class="LineNr">31 </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 < <a href='001help.cc.html#L166'>SIZE</a><span class="Delimiter">(</span><a href='031check_operands.cc.html#L11'>code</a><span class="Delimiter">.</span><a href='011run.cc.html#L105'>lines</a><span class="Delimiter">);</span> ++i<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L32" class="LineNr">32 </span> <span class="Normal">const</span> line& inst = <a href='031check_operands.cc.html#L11'>code</a><span class="Delimiter">.</span><a href='011run.cc.html#L105'>lines</a><span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">);</span> <span id="L33" class="LineNr">33 </span> <span class="Normal">for</span> <span class="Delimiter">(</span><span class="Normal">int</span> j = <a href='031check_operands.cc.html#L301'>first_operand</a><span class="Delimiter">(</span>inst<span class="Delimiter">);</span> j < <a href='001help.cc.html#L166'>SIZE</a><span class="Delimiter">(</span>inst<span class="Delimiter">.</span><a href='011run.cc.html#L114'>words</a><span class="Delimiter">);</span> ++j<span class="Delimiter">)</span> <span id="L34" class="LineNr">34 </span> check_operand_bounds<span class="Delimiter">(</span>inst<span class="Delimiter">.</span><a href='011run.cc.html#L114'>words</a><span class="Delimiter">.</span>at<span class="Delimiter">(</span>j<span class="Delimiter">));</span> -<span id="L35" class="LineNr">35 </span> <span class="Normal">if</span> <span class="Delimiter">(</span><a href='003trace.cc.html#L204'>trace_contains_errors</a><span class="Delimiter">())</span> <span class="Identifier">return</span><span class="Delimiter">;</span> <span class="Comment">// stop at the first mal-formed instruction</span> +<span id="L35" class="LineNr">35 </span> <span class="Normal">if</span> <span class="Delimiter">(</span><a href='003trace.cc.html#L230'>trace_contains_errors</a><span class="Delimiter">())</span> <span class="Identifier">return</span><span class="Delimiter">;</span> <span class="Comment">// stop at the first mal-formed instruction</span> <span id="L36" class="LineNr">36 </span> <span class="Delimiter">}</span> <span id="L37" class="LineNr">37 </span><span class="Delimiter">}</span> <span id="L38" class="LineNr">38 </span> @@ -102,15 +102,15 @@ if ('onhashchange' in window) { <span id="L40" class="LineNr">40 </span> <span class="Normal">for</span> <span class="Delimiter">(</span>map<string<span class="Delimiter">,</span> <span class="Normal">uint32_t</span>>::iterator p = <span class="Special"><a href='032check_operand_bounds.cc.html#L10'>Operand_bound</a></span><span class="Delimiter">.</span>begin<span class="Delimiter">();</span> p != <span class="Special"><a href='032check_operand_bounds.cc.html#L10'>Operand_bound</a></span><span class="Delimiter">.</span>end<span class="Delimiter">();</span> ++p<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L41" class="LineNr">41 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!has_operand_metadata<span class="Delimiter">(</span>w<span class="Delimiter">,</span> p<span class="Delimiter">-></span>first<span class="Delimiter">))</span> <span class="Identifier">continue</span><span class="Delimiter">;</span> <span id="L42" class="LineNr">42 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!looks_like_hex_int<span class="Delimiter">(</span>w<span class="Delimiter">.</span>data<span class="Delimiter">))</span> <span class="Identifier">continue</span><span class="Delimiter">;</span> <span class="Comment">// later transforms are on their own to do their own bounds checking</span> -<span id="L43" class="LineNr">43 </span> <span class="Normal">int32_t</span> x = <a href='011run.cc.html#L360'>parse_int</a><span class="Delimiter">(</span>w<span class="Delimiter">.</span>data<span class="Delimiter">);</span> +<span id="L43" class="LineNr">43 </span> <span class="Normal">int32_t</span> x = <a href='011run.cc.html#L355'>parse_int</a><span class="Delimiter">(</span>w<span class="Delimiter">.</span>data<span class="Delimiter">);</span> <span id="L44" class="LineNr">44 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>x >= <span class="Constant">0</span><span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L45" class="LineNr">45 </span> <span class="Normal">if</span> <span class="Delimiter">(</span><span class="Normal">static_cast</span><<span class="Normal">uint32_t</span>><span class="Delimiter">(</span>x<span class="Delimiter">)</span> >= p<span class="Delimiter">-></span>second<span class="Delimiter">)</span> -<span id="L46" class="LineNr">46 </span> <a href='003trace.cc.html#L190'>raise</a> << <span class="Constant">"'"</span> << w<span class="Delimiter">.</span>original << <span class="Constant">"' too large to fit in bitfield "</span> << p<span class="Delimiter">-></span>first << <span class="cSpecial">'\n'</span> << end<span class="Delimiter">();</span> +<span id="L46" class="LineNr">46 </span> <a href='003trace.cc.html#L217'>raise</a> << <span class="Constant">"'"</span> << w<span class="Delimiter">.</span>original << <span class="Constant">"' too large to fit in bitfield "</span> << p<span class="Delimiter">-></span>first << <span class="cSpecial">'\n'</span> << end<span class="Delimiter">();</span> <span id="L47" class="LineNr">47 </span> <span class="Delimiter">}</span> <span id="L48" class="LineNr">48 </span> <span class="Normal">else</span> <span class="Delimiter">{</span> <span id="L49" class="LineNr">49 </span> <span class="Comment">// hacky? assuming bound is a power of 2</span> <span id="L50" class="LineNr">50 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>x < -<span class="Constant">1</span>*<span class="Normal">static_cast</span><<span class="Normal">int32_t</span>><span class="Delimiter">(</span>p<span class="Delimiter">-></span>second/<span class="Constant">2</span><span class="Delimiter">))</span> -<span id="L51" class="LineNr">51 </span> <a href='003trace.cc.html#L190'>raise</a> << <span class="Constant">"'"</span> << w<span class="Delimiter">.</span>original << <span class="Constant">"' too large to fit in bitfield "</span> << p<span class="Delimiter">-></span>first << <span class="cSpecial">'\n'</span> << end<span class="Delimiter">();</span> +<span id="L51" class="LineNr">51 </span> <a href='003trace.cc.html#L217'>raise</a> << <span class="Constant">"'"</span> << w<span class="Delimiter">.</span>original << <span class="Constant">"' too large to fit in bitfield "</span> << p<span class="Delimiter">-></span>first << <span class="cSpecial">'\n'</span> << end<span class="Delimiter">();</span> <span id="L52" class="LineNr">52 </span> <span class="Delimiter">}</span> <span id="L53" class="LineNr">53 </span> <span class="Delimiter">}</span> <span id="L54" class="LineNr">54 </span><span class="Delimiter">}</span> |