From caa0167457f83b3bdda99b1385b1816a3ea3947d Mon Sep 17 00:00:00 2001 From: Vyacheslav Egorov Date: Sat, 15 Oct 2016 23:02:49 +0200 Subject: [PATCH] Don't use in-class initialization of non-static data members. It's a C++11 extension. TBR=asiva@google.com Review URL: https://codereview.chromium.org/2420323002 . --- runtime/vm/kernel_to_il.h | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/runtime/vm/kernel_to_il.h b/runtime/vm/kernel_to_il.h index ccf4801a81e..6f50949e500 100644 --- a/runtime/vm/kernel_to_il.h +++ b/runtime/vm/kernel_to_il.h @@ -382,34 +382,43 @@ struct FunctionScope { class ScopeBuildingResult : public ZoneAllocated { public: + ScopeBuildingResult() + : this_variable(NULL), + type_arguments_variable(NULL), + switch_variable(NULL), + finally_return_variable(NULL), + setter_value(NULL), + yield_jump_variable(NULL), + yield_context_variable(NULL) {} + Map locals; Map scopes; GrowableArray function_scopes; // Only non-NULL for instance functions. - LocalVariable* this_variable = NULL; + LocalVariable* this_variable; // Only non-NULL for factory constructor functions. - LocalVariable* type_arguments_variable = NULL; + LocalVariable* type_arguments_variable; // Non-NULL when the function contains a switch statement. - LocalVariable* switch_variable = NULL; + LocalVariable* switch_variable; // Non-NULL when the function contains a return inside a finally block. - LocalVariable* finally_return_variable = NULL; + LocalVariable* finally_return_variable; // Non-NULL when the function is a setter. - LocalVariable* setter_value = NULL; + LocalVariable* setter_value; // Non-NULL if the function contains yield statement. // TODO(27590) actual variable is called :await_jump_var, we should rename // it to reflect the fact that it is used for both await and yield. - LocalVariable* yield_jump_variable = NULL; + LocalVariable* yield_jump_variable; // Non-NULL if the function contains yield statement. // TODO(27590) actual variable is called :await_ctx_var, we should rename // it to reflect the fact that it is used for both await and yield. - LocalVariable* yield_context_variable = NULL; + LocalVariable* yield_context_variable; // Variables used in exception handlers, one per exception handler nesting // level.