diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2012-10-28 10:43:31 -0700 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2012-10-28 10:43:31 -0700 |
| commit | 69e2d272457f2f096c2514d8afb90006ed577fc9 (patch) | |
| tree | cda613d41422a763d824ce998b0e6d0cefd4aaa3 /src/parse.y | |
| parent | 559933f577d5073464aa06facc1b754de6225d8a (diff) | |
| parent | 1933e2660c86c0731806993a9a212116bb454622 (diff) | |
| download | mruby-69e2d272457f2f096c2514d8afb90006ed577fc9.tar.gz mruby-69e2d272457f2f096c2514d8afb90006ed577fc9.zip | |
Merge pull request #507 from monaka/pr-not-use-memset-in-structure-initialization
Use substitution instead of memset in structure initializations.
Diffstat (limited to 'src/parse.y')
| -rw-r--r-- | src/parse.y | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/parse.y b/src/parse.y index b903ac840..cffb6ba09 100644 --- a/src/parse.y +++ b/src/parse.y @@ -4747,13 +4747,14 @@ mrb_parser_new(mrb_state *mrb) { mrb_pool *pool; parser_state *p; + static const parser_state parser_state_zero = { 0 }; pool = mrb_pool_open(mrb); if (!pool) return 0; p = (parser_state *)mrb_pool_alloc(pool, sizeof(parser_state)); if (!p) return 0; - memset(p, 0, sizeof(parser_state)); + *p = parser_state_zero; p->mrb = mrb; p->pool = pool; p->in_def = p->in_single = 0; |
