1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-17 01:00:20 +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

@ -592,6 +592,8 @@ extern void _jit_set_note(jit_state_t*, jit_note_t*, char*, int, jit_int32_t);
#define jit_annotate() _jit_annotate(_jit)
extern void _jit_annotate(jit_state_t*);
extern jit_pointer_t jit_memcpy(jit_pointer_t,jit_pointer_t,jit_word_t);
extern jit_pointer_t jit_memmove(jit_pointer_t,jit_pointer_t,jit_word_t);
extern void jit_alloc(jit_pointer_t*, jit_word_t);
extern void jit_realloc(jit_pointer_t*, jit_word_t, jit_word_t);
void jit_free(jit_pointer_t*);