mirror of
				https://github.com/janet-lang/janet
				synced 2025-10-31 07:33:01 +00:00 
			
		
		
		
	add NULL check in gc.c to avoid UB
After the UB was fixed in value.c, I tried running the build again and encoutered another instance of UB in gc.c. With this fixed I can now build janet with ubsan enabled, meaning there's no more UB encountered in janet_boot during the build.
This commit is contained in:
		| @@ -123,6 +123,8 @@ static void janet_mark_abstract(void *adata) { | |||||||
|  |  | ||||||
| /* Mark a bunch of items in memory */ | /* Mark a bunch of items in memory */ | ||||||
| static void janet_mark_many(const Janet *values, int32_t n) { | static void janet_mark_many(const Janet *values, int32_t n) { | ||||||
|  |     if (values == NULL) | ||||||
|  |         return; | ||||||
|     const Janet *end = values + n; |     const Janet *end = values + n; | ||||||
|     while (values < end) { |     while (values < end) { | ||||||
|         janet_mark(*values); |         janet_mark(*values); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Jonathan Marler
					Jonathan Marler