From fc339c65ad0fffc2e5bc8332bab9c1c70329c04e Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Fri, 26 Aug 2016 10:04:39 +0300 Subject: [PATCH] Eliminate CSA false warning about null dereference in array_mark_proc The exact warning message is: Access to field 'mse_start' results in a dereference of a null pointer (loaded from variable 'new_mark_stack_ptr'). * typd_mlc.c (GC_array_mark_proc): Add assertion that mark_stack_ptr is non-NULL (thus orig_mark_stack_ptr is non-NULL too). --- typd_mlc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/typd_mlc.c b/typd_mlc.c index 839c3144..8e92cda1 100644 --- a/typd_mlc.c +++ b/typd_mlc.c @@ -499,6 +499,7 @@ STATIC mse * GC_array_mark_proc(word * addr, mse * mark_stack_ptr, /* and request a mark stack expansion. */ /* This cannot cause a mark stack overflow, since it replaces */ /* the original array entry. */ + GC_ASSERT(mark_stack_ptr != NULL); GC_mark_stack_too_small = TRUE; new_mark_stack_ptr = orig_mark_stack_ptr + 1; new_mark_stack_ptr -> mse_start = (ptr_t)addr; -- 2.40.0