diff options
author | Peter Zhu <peter@peterzhu.ca> | 2024-02-20 17:18:11 -0500 |
---|---|---|
committer | Peter Zhu <peter@peterzhu.ca> | 2024-02-21 10:13:36 -0500 |
commit | 402690c3b60b61dce3a251acb46bfe9a615a25bb (patch) | |
tree | 347872304acd486d77005a211e04960b59c3b2bc /gc.c | |
parent | 01c7e16c0ce66cfa745d49cd4f18d43c23dbe225 (diff) |
Fix incomplete switch statement in imemo_memsize
The switch statement is not exhaustive, meaning the "unreachable"
comment was not correct. This commit fixes it by making the list
exhaustive and adding an rb_bug in the default case.
Diffstat (limited to 'gc.c')
-rw-r--r-- | gc.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -3060,6 +3060,9 @@ imemo_memsize(VALUE obj) case imemo_ast: size += rb_ast_memsize(&RANY(obj)->as.imemo.ast); break; + case imemo_callcache: + case imemo_callinfo: + case imemo_constcache: case imemo_cref: case imemo_svar: case imemo_throw_data: @@ -3068,7 +3071,7 @@ imemo_memsize(VALUE obj) case imemo_parser_strterm: break; default: - /* unreachable */ + rb_bug("unreachable"); break; } return size; |