1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-21 11:10:21 +02:00

Do not pass null for free, memcpy and memmove

* lib/jit_memory.c: Do not call free on NULL pointers.

	* include/lightning/jit_private.h, lib/jit_note.c,
	lib/lightning.c: Add a wrapper to memcpy and memmove
	to not actually call those functions with a zero size
	argument, and likely also a null src or dst.
This commit is contained in:
pcpa 2014-07-29 10:29:49 -03:00
parent a8c180a926
commit 0d9ac79a12
6 changed files with 52 additions and 19 deletions

View file

@ -1750,7 +1750,7 @@ _flush_consts(jit_state_t *_jit)
_jitc->consts.size = _jitc->consts.length << 2;
/* FIXME check will not overrun, otherwise, need to reallocate
* code buffer and start over */
memcpy(_jitc->consts.data, _jitc->consts.values, _jitc->consts.size);
jit_memcpy(_jitc->consts.data, _jitc->consts.values, _jitc->consts.size);
_jit->pc.w += _jitc->consts.size;
#if DISASSEMBLER