From fa2543684b378e59880b3337d4a3cf041b21ac8e Mon Sep 17 00:00:00 2001 From: Jean Privat Date: Fri, 6 Mar 2015 22:44:58 +0700 Subject: [PATCH] compiler: do not initialize attributes at NULL in NEW_* is is already done by the zeroing Signed-off-by: Jean Privat --- src/compiler/abstract_compiler.nit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/abstract_compiler.nit b/src/compiler/abstract_compiler.nit index b53a7a2..23927b6 100644 --- a/src/compiler/abstract_compiler.nit +++ b/src/compiler/abstract_compiler.nit @@ -2304,7 +2304,7 @@ redef class AAttrPropdef fun init_expr(v: AbstractCompilerVisitor, recv: RuntimeVariable) do - if has_value and not is_lazy then evaluate_expr(v, recv) + if has_value and not is_lazy and not n_expr isa ANullExpr then evaluate_expr(v, recv) end # Evaluate, store and return the default value of the attribute -- 1.7.9.5