1
0
mirror of https://github.com/janet-lang/janet synced 2024-11-28 19:19:53 +00:00

Fix number parsing.

This commit is contained in:
Calvin Rose 2018-09-06 14:12:10 -04:00
parent c8ef2a0d88
commit 2a907f8290
2 changed files with 2 additions and 1 deletions

View File

@ -199,6 +199,7 @@ static struct JanetScanRes janet_scan_impl(
res.foundexp = 1; res.foundexp = 1;
break; break;
} else if (!gotradix && (*str == 'x' || *str == 'X')) { } else if (!gotradix && (*str == 'x' || *str == 'X')) {
if (!seenadigit) goto error;
if (res.seenpoint || res.mant > 0) goto error; if (res.seenpoint || res.mant > 0) goto error;
res.base = 16; res.base = 16;
res.mant = 0; res.mant = 0;

View File

@ -1333,7 +1333,7 @@ int janet_init(void) {
* a collection pretty much every cycle, which is * a collection pretty much every cycle, which is
* incredibly horrible for performance, but can help ensure * incredibly horrible for performance, but can help ensure
* there are no memory bugs during development */ * there are no memory bugs during development */
janet_vm_gc_interval = 0x10000; janet_vm_gc_interval = 0x1000000;
janet_symcache_init(); janet_symcache_init();
/* Initialize gc roots */ /* Initialize gc roots */
janet_vm_roots = NULL; janet_vm_roots = NULL;