src: Add arity check on INative constructor
authorAlexandre Terrasa <alexandre@moz-concept.com>
Thu, 14 Apr 2011 21:26:12 +0000 (17:26 -0400)
committerAlexandre Terrasa <alexandre@moz-concept.com>
Thu, 14 Apr 2011 21:26:12 +0000 (17:26 -0400)
Signed-off-by: Alexandre Terrasa <alexandre@moz-concept.com>

src/icode/icode_base.nit

index 09c966b..5ceb1cb 100644 (file)
@@ -332,7 +332,10 @@ class INative
 
        init(m: MMMethod, e: nullable Sequence[IRegister])
        do
-               super(e)
+                # Checks that arguments contains at least one IRegister element
+                assert e.length == m.signature.arity + 1
+               
+                super(e)
                _method = m
        end