icode: duplicate ICodeN::closure_defs in dup_with
authorJean Privat <jean@pryen.org>
Mon, 17 Aug 2009 18:50:01 +0000 (14:50 -0400)
committerJean Privat <jean@pryen.org>
Mon, 17 Aug 2009 18:56:54 +0000 (14:56 -0400)
Fix issue with inlining of calls with closures.

Signed-off-by: Jean Privat <jean@pryen.org>

src/icode/icode_tools.nit

index 3f6c91e..3884840 100644 (file)
@@ -170,6 +170,10 @@ redef class ICode
        private fun dup_with(d: ICodeDupContext)
        do
                var c = inner_dup_with(d)
+               if self isa ICodeN then
+                       assert c isa ICodeN
+                       c.closure_defs = closure_defs
+               end
                var r = result
                if r != null then c.result = d.dup_ireg(r)
                c.location = location