Skip to content

Instantly share code, notes, and snippets.

@squeaky-pl
Created February 14, 2014 20:50
Show Gist options
  • Save squeaky-pl/9008978 to your computer and use it in GitHub Desktop.
Save squeaky-pl/9008978 to your computer and use it in GitHub Desktop.
+476: i58 = getarrayitem_raw(i57, i42, descr=<ArrayU 1>)
debug_merge_point(0, 0, '<code object add. file 'test.py'. line 18> #33 BINARY_ADD')
+488: i59 = int_add_ovf(i53, i58)
guard_no_overflow(descr=<Guard0x7f9d69aaaf70>) [p1, p0, i59, p2, p3, p6, p7, p12, p14, p16, p20, i58, i53, i42]
rawarraydescr_char = cpu.arraydescrof(lltype.Array(lltype.Char,
hints={'nolength': True}))
diff -r 17003c30fe47 rpython/jit/metainterp/optimizeopt/test/test_optimizebasic.py
--- a/rpython/jit/metainterp/optimizeopt/test/test_optimizebasic.py Fri Feb 14 19:23:18 2014 +0100
+++ b/rpython/jit/metainterp/optimizeopt/test/test_optimizebasic.py Fri Feb 14 21:41:31 2014 +0100
@@ -5214,6 +5214,20 @@
"""
self.optimize_loop(ops, expected)
+ def test_rawarray_cmp_outside_intbounds(self):
+ ops = """
+ [i0]
+ i1 = getarrayitem_raw(i0, 0, descr=rawarraydescr_char)
+ i2 = int_lt(i1, 256)
+ guard_true(i2) []
+ """
+
+ expected = """
+ [i0]
+ i1 = getarrayitem_raw(i0, 0, descr=rawarraydescr_char)
+ """
+ self.optimize_loop(ops, expected)
+
class TestLLtype(BaseTestOptimizeBasic, LLtypeMixin):
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment