summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorKOBAYASHI Shuji <[email protected]>2019-02-14 18:48:41 +0900
committerKOBAYASHI Shuji <[email protected]>2019-02-14 18:48:41 +0900
commit921af6923d5e55992983d2f4e7930b8a97571448 (patch)
tree507d2992ac9c079cb9d4967456d08e840937c583
parent01c908117dcb5182fa276b2d80ee7eaa4dd34d66 (diff)
downloadmruby-921af6923d5e55992983d2f4e7930b8a97571448.tar.gz
mruby-921af6923d5e55992983d2f4e7930b8a97571448.zip
Use `mrb_assert()` for checking `sym` in `sym_inline_unpack()`
-rw-r--r--src/symbol.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/symbol.c b/src/symbol.c
index 9cc566245..ac313665c 100644
--- a/src/symbol.c
+++ b/src/symbol.c
@@ -73,9 +73,9 @@ sym_inline_unpack(mrb_sym sym, char *buf)
{
int i;
- if (sym == 0) return NULL;
- if ((sym&1) == 0) return NULL; /* need to be inline sym */
- if (sym&2) { /* all lower case (5bits/char) */
+ mrb_assert(sym&1);
+
+ if (sym&2) { /* all lower case (5bits/char) */
for (i=0; i<6; i++) {
uint32_t bits;
char c;