diff --git a/src/codegen.c b/src/codegen.c index 8aef2a328..963e94b21 100644 --- a/src/codegen.c +++ b/src/codegen.c @@ -802,6 +802,7 @@ readint_float(codegen_scope *s, const char *p, int base) mrb_float f = 0; int n; + if (*p == '+') p++; while (p < e) { char c = *p; c = tolower((unsigned char)c); @@ -812,6 +813,9 @@ readint_float(codegen_scope *s, const char *p, int base) break; } } + if (n == base) { + codegen_error(s, "malformed readint input"); + } p++; } return f;