From d6f368a3f400fea3e89280262a8147e7ce5d855c Mon Sep 17 00:00:00 2001 From: dec05eba Date: Thu, 22 Aug 2019 00:59:49 +0200 Subject: Move thread work from compiler/parser to thread_work file, fix use after free bug in multithreaded parser allocator --- src/ssa/ssa.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'src/ssa') diff --git a/src/ssa/ssa.c b/src/ssa/ssa.c index 39b5a80..500555a 100644 --- a/src/ssa/ssa.c +++ b/src/ssa/ssa.c @@ -551,10 +551,8 @@ static CHECK_RESULT SsaRegister funccall_generate_ssa(FunctionCall *self, AstRes LhsExpr *func_lhs_expr; { - Ast **arg; - Ast **arg_end; - arg = buffer_begin(&self->args); - arg_end = buffer_end(&self->args); + Ast **arg = buffer_begin(&self->args); + Ast **arg_end = buffer_end(&self->args); for(; arg != arg_end; ++arg) { SsaRegister arg_reg; arg_reg = ast_generate_ssa(*arg, context); @@ -781,10 +779,8 @@ CHECK_RESULT SsaRegister scope_named_object_generate_ssa(ScopeNamedObject *self, } void scope_generate_ssa(Scope *self, SsaCompilerContext *context) { - Ast **ast; - Ast **ast_end; - ast = buffer_begin(&self->ast_objects); - ast_end = buffer_end(&self->ast_objects); + Ast **ast = buffer_begin(&self->ast_objects); + Ast **ast_end = buffer_end(&self->ast_objects); for(; ast != ast_end; ++ast) { ignore_result_int(ast_generate_ssa(*ast, context)); } -- cgit v1.2.3