代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/flex 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From faa877a8434a1d2f1b2ab5315eee6ca44dc79629 Mon Sep 17 00:00:00 2001
From: "viktor.shepel" <shepelvictor@bigmir.net>
Date: Tue, 20 Jun 2017 18:22:53 +0300
Subject: [PATCH] scanner: memory leak free scanner generator.
**Issue:**
Scanner generation leaks memory for transition tables when invoked
without `--tables-file` option.
**Root cause:**
`gentabs` function has different memory acquire/release conditions.
**Solution:**
Reclaim memory at the same scope where it was alloacated.
---
src/gen.c | 27 +++++++++++++--------------
1 file changed, 13 insertions(+), 14 deletions(-)
diff --git a/src/gen.c b/src/gen.c
index 590e5d8..ec0e014 100644
--- a/src/gen.c
+++ b/src/gen.c
@@ -1234,9 +1234,9 @@ void gentabs (void)
yytbl_data_compress (yyacc_tbl);
if (yytbl_data_fwrite (&tableswr, yyacc_tbl) < 0)
flexerror (_("Could not write yyacc_tbl"));
- yytbl_data_destroy (yyacc_tbl);
- yyacc_tbl = NULL;
}
+ yytbl_data_destroy (yyacc_tbl);
+ yyacc_tbl = NULL;
/* End generating yy_accept */
if (useecs) {
@@ -1289,11 +1289,10 @@ void gentabs (void)
if (tablesext) {
yytbl_data_compress (yymeta_tbl);
if (yytbl_data_fwrite (&tableswr, yymeta_tbl) < 0)
- flexerror (_
- ("Could not write yymeta_tbl"));
- yytbl_data_destroy (yymeta_tbl);
- yymeta_tbl = NULL;
+ flexerror (_("Could not write yymeta_tbl"));
}
+ yytbl_data_destroy (yymeta_tbl);
+ yymeta_tbl = NULL;
/* End generating yy_meta */
}
@@ -1350,9 +1349,9 @@ void gentabs (void)
yytbl_data_compress (yybase_tbl);
if (yytbl_data_fwrite (&tableswr, yybase_tbl) < 0)
flexerror (_("Could not write yybase_tbl"));
- yytbl_data_destroy (yybase_tbl);
- yybase_tbl = NULL;
}
+ yytbl_data_destroy (yybase_tbl);
+ yybase_tbl = NULL;
/* End generating yy_base */
@@ -1382,9 +1381,9 @@ void gentabs (void)
yytbl_data_compress (yydef_tbl);
if (yytbl_data_fwrite (&tableswr, yydef_tbl) < 0)
flexerror (_("Could not write yydef_tbl"));
- yytbl_data_destroy (yydef_tbl);
- yydef_tbl = NULL;
}
+ yytbl_data_destroy (yydef_tbl);
+ yydef_tbl = NULL;
/* End generating yy_def */
@@ -1420,9 +1419,9 @@ void gentabs (void)
yytbl_data_compress (yynxt_tbl);
if (yytbl_data_fwrite (&tableswr, yynxt_tbl) < 0)
flexerror (_("Could not write yynxt_tbl"));
- yytbl_data_destroy (yynxt_tbl);
- yynxt_tbl = NULL;
}
+ yytbl_data_destroy (yynxt_tbl);
+ yynxt_tbl = NULL;
/* End generating yy_nxt */
/* Begin generating yy_chk */
@@ -1454,9 +1453,9 @@ void gentabs (void)
yytbl_data_compress (yychk_tbl);
if (yytbl_data_fwrite (&tableswr, yychk_tbl) < 0)
flexerror (_("Could not write yychk_tbl"));
- yytbl_data_destroy (yychk_tbl);
- yychk_tbl = NULL;
}
+ yytbl_data_destroy (yychk_tbl);
+ yychk_tbl = NULL;
/* End generating yy_chk */
free(acc_array);
--
1.8.3.1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。