diff --git a/main/gbc/gbc_trans_expr.c b/main/gbc/gbc_trans_expr.c index 10979d8e8..4ded080e3 100644 --- a/main/gbc/gbc_trans_expr.c +++ b/main/gbc/gbc_trans_expr.c @@ -888,7 +888,7 @@ static void trans_expression(bool check_statement) JOB->step = JOB_STEP_CODE; FREE(&tree); - FREE(&_tree_pos); + _tree_pos = NULL; _tree_length = 0; if (check_statement) diff --git a/main/gbc/gbc_trans_tree.c b/main/gbc/gbc_trans_tree.c index b07fe93e3..4f5ba5005 100644 --- a/main/gbc/gbc_trans_tree.c +++ b/main/gbc/gbc_trans_tree.c @@ -832,10 +832,7 @@ void TRANS_tree(bool check_statement, TRANS_TREE **result, int *count, int **res ALLOC(result, sizeof(PATTERN) * _tree_length); memcpy(*result, _tree, sizeof(PATTERN) * _tree_length); if (result_pos) - { - ALLOC(result_pos, sizeof(int) * _tree_length); - memcpy(*result_pos, _tree_pos, sizeof(int) * _tree_length); - } + *result_pos = _tree_pos; *count = _tree_length - 1; } }