lib/standard/fixed_ints: Added extra check on is_int to avoid crashing on indexed...
authorLucas Bajolet <r4pass@hotmail.com>
Fri, 21 Aug 2015 21:22:37 +0000 (17:22 -0400)
committerLucas Bajolet <r4pass@hotmail.com>
Fri, 21 Aug 2015 21:22:37 +0000 (17:22 -0400)
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>

lib/standard/fixed_ints.nit

index 6dc6550..daad211 100644 (file)
@@ -883,7 +883,9 @@ redef class Text
        #     assert "0b1011".is_int
        #     assert not "0x_".is_int
        #     assert not "0xGE".is_int
+       #     assert not "".is_int
        fun is_int: Bool do
+               if bytelen == 0 then return false
                var s = remove_all('_')
                var pos = 0
                while s[pos] == '-' do