From d5a5f2b353b8d1e18e27982669368a43ff382445 Mon Sep 17 00:00:00 2001 From: Lucas Bajolet Date: Fri, 21 Aug 2015 17:22:37 -0400 Subject: [PATCH] lib/standard/fixed_ints: Added extra check on is_int to avoid crashing on indexed access Signed-off-by: Lucas Bajolet --- lib/standard/fixed_ints.nit | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/standard/fixed_ints.nit b/lib/standard/fixed_ints.nit index 6dc6550..daad211 100644 --- a/lib/standard/fixed_ints.nit +++ b/lib/standard/fixed_ints.nit @@ -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 -- 1.7.9.5