summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/codegen.c4
1 files changed, 4 insertions, 0 deletions
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;