mirror of
https://github.com/janet-lang/janet
synced 2025-07-04 11:02:55 +00:00
Work on addressing #1337 - fix valgrind case.
This commit is contained in:
parent
a10b4f61d8
commit
11d7af3f95
@ -233,8 +233,8 @@ const uint8_t *janet_symbol_gen(void) {
|
|||||||
head->length = sizeof(janet_vm.gensym_counter) - 1;
|
head->length = sizeof(janet_vm.gensym_counter) - 1;
|
||||||
head->hash = hash;
|
head->hash = hash;
|
||||||
sym = (uint8_t *)(head->data);
|
sym = (uint8_t *)(head->data);
|
||||||
sym[head->length] = 0;
|
|
||||||
memcpy(sym, janet_vm.gensym_counter, sizeof(janet_vm.gensym_counter));
|
memcpy(sym, janet_vm.gensym_counter, sizeof(janet_vm.gensym_counter));
|
||||||
|
sym[head->length] = 0;
|
||||||
janet_symcache_put((const uint8_t *)sym, bucket);
|
janet_symcache_put((const uint8_t *)sym, bucket);
|
||||||
return (const uint8_t *)sym;
|
return (const uint8_t *)sym;
|
||||||
}
|
}
|
||||||
|
@ -366,4 +366,10 @@
|
|||||||
(exec-slurp ;run janet "-e" "(print :hi)")))
|
(exec-slurp ;run janet "-e" "(print :hi)")))
|
||||||
"exec-slurp 1"))
|
"exec-slurp 1"))
|
||||||
|
|
||||||
|
# valgrind-able check for #1337
|
||||||
|
(def superv (ev/chan 10))
|
||||||
|
(def f (ev/go |(ev/sleep 1e9) nil superv))
|
||||||
|
(ev/cancel f (gensym))
|
||||||
|
(ev/take superv)
|
||||||
|
|
||||||
(end-suite)
|
(end-suite)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user