fix core dump on vcase_expr::close (#9875)
This commit is contained in:
@ -68,19 +68,15 @@ Status VCaseExpr::open(RuntimeState* state, VExprContext* context,
|
||||
FunctionContext::FunctionStateScope scope) {
|
||||
RETURN_IF_ERROR(VExpr::open(state, context, scope));
|
||||
RETURN_IF_ERROR(VExpr::init_function_context(context, scope, _function));
|
||||
|
||||
CaseState* case_state = new CaseState {_data_type};
|
||||
context->fn_context(_fn_context_index)
|
||||
->set_function_state(FunctionContext::FRAGMENT_LOCAL, case_state);
|
||||
context->fn_context(_fn_context_index)->set_function_state(scope, case_state);
|
||||
|
||||
return Status::OK();
|
||||
}
|
||||
|
||||
void VCaseExpr::close(RuntimeState* state, VExprContext* context,
|
||||
FunctionContext::FunctionStateScope scope) {
|
||||
CaseState* case_state = reinterpret_cast<CaseState*>(
|
||||
context->fn_context(_fn_context_index)
|
||||
->get_function_state(FunctionContext::FRAGMENT_LOCAL));
|
||||
delete case_state;
|
||||
|
||||
VExpr::close_function_context(context, scope, _function);
|
||||
VExpr::close(state, context, scope);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user