core: fix warnings in re
authorAlexandre Terrasa <alexandre@moz-code.org>
Wed, 20 Apr 2016 05:54:21 +0000 (01:54 -0400)
committerAlexandre Terrasa <alexandre@moz-code.org>
Tue, 31 May 2016 23:43:20 +0000 (19:43 -0400)
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

lib/core/re.nit

index 917ec4f..0ac109c 100644 (file)
@@ -183,7 +183,7 @@ class Regex
        # Cache of a single `regmatch_t` to prevent many calls to `malloc`
        private var native_match: NativeMatchArray is lazy do
                native_match_is_init = true
-               return new NativeMatchArray.malloc(native.re_nsub+1)
+               return new NativeMatchArray.malloc(native.as(not null).re_nsub+1)
        end
 
        private var native_match_is_init = false