diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2021-06-19 21:18:27 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2021-06-19 21:18:27 +0900 |
| commit | 1fca58f7ca63b6a7e372be75cab2da52725c26e7 (patch) | |
| tree | d71db1d47a2ce49754cccbe6c5bb9d3ee8047e3b /mrbgems/mruby-compiler/core/codegen.c | |
| parent | 43eddfd4d52a1c21fb248b979fbcc7321fabe73b (diff) | |
| download | mruby-1fca58f7ca63b6a7e372be75cab2da52725c26e7.tar.gz mruby-1fca58f7ca63b6a7e372be75cab2da52725c26e7.zip | |
codegen.c: stop `uninitialized` warning.
Diffstat (limited to 'mrbgems/mruby-compiler/core/codegen.c')
| -rw-r--r-- | mrbgems/mruby-compiler/core/codegen.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/mrbgems/mruby-compiler/core/codegen.c b/mrbgems/mruby-compiler/core/codegen.c index 06696850f..be231ecfc 100644 --- a/mrbgems/mruby-compiler/core/codegen.c +++ b/mrbgems/mruby-compiler/core/codegen.c @@ -1452,11 +1452,11 @@ readint(codegen_scope *s, const char *p, int base, mrb_bool *overflow) { const char *e = p + strlen(p); mrb_int result = 0; - int n; mrb_assert(base >= 2 && base <= 36); if (*p == '+') p++; while (p < e) { + int n; char c = *p; switch (c) { case '0': case '1': case '2': case '3': @@ -1470,6 +1470,8 @@ readint(codegen_scope *s, const char *p, int base, mrb_bool *overflow) n = c - 'A' + 10; break; default: codegen_error(s, "malformed readint input"); + /* not reached */ + return result; } if (mrb_int_mul_overflow(result, base, &result) || mrb_int_add_overflow(result, n, &result)) { |
