]> granicus.if.org Git - gc/commitdiff
Place no_sanitize address/memory attributes in a GCC-compliant way
authorIvan Maidanski <ivmai@mail.ru>
Mon, 20 Nov 2017 21:10:08 +0000 (00:10 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Fri, 15 Dec 2017 21:09:03 +0000 (00:09 +0300)
(Cherry-pick commit 2914cbff from 'master' branch.)

Now the attributes precede the function prototypes (the format is:
<attribute> void f(void) <body>).

* mark.c (GC_mark_from, GC_push_all_eager): Move
GC_ATTR_NO_SANITIZE_ADDR, GC_ATTR_NO_SANITIZE_MEMORY attributes to the
beginning of the function prototype.
* mach_dep.c (GC_with_callee_saves_pushed): Likewise.
* mark.c [WRAP_MARK_SOME && PARALLEL_MARK] (GC_push_conditional_eager):
Likewise.

mach_dep.c
mark.c

index 62b7a37bb3cb08c8cfe767cafaff8cbb1f17441d..5f64d4dc69a721a6574c767faefa061d942f41cc 100644 (file)
 /* Ensure that either registers are pushed, or callee-save registers    */
 /* are somewhere on the stack, and then call fn(arg, ctxt).             */
 /* ctxt is either a pointer to a ucontext_t we generated, or NULL.      */
+GC_ATTR_NO_SANITIZE_ADDR
 GC_INNER void GC_with_callee_saves_pushed(void (*fn)(ptr_t, void *),
                                           volatile ptr_t arg)
-                                          GC_ATTR_NO_SANITIZE_ADDR
 {
   volatile int dummy;
   void * volatile context = 0;
diff --git a/mark.c b/mark.c
index ede92c61e8987b820074dc708c8df187628c21ff..4b143ddce71815f563979981ca183cac6f653975 100644 (file)
--- a/mark.c
+++ b/mark.c
@@ -635,9 +635,9 @@ GC_INNER mse * GC_signal_mark_stack_overflow(mse *msp)
  * encoding, we optionally maintain a cache for the block address to
  * header mapping, we prefetch when an object is "grayed", etc.
  */
+GC_ATTR_NO_SANITIZE_ADDR GC_ATTR_NO_SANITIZE_MEMORY
 GC_INNER mse * GC_mark_from(mse *mark_stack_top, mse *mark_stack,
                             mse *mark_stack_limit)
-                        GC_ATTR_NO_SANITIZE_ADDR GC_ATTR_NO_SANITIZE_MEMORY
 {
   signed_word credit = HBLKSIZE;  /* Remaining credit for marking work  */
   ptr_t current_p;      /* Pointer to current candidate ptr.            */
@@ -1561,8 +1561,8 @@ GC_API void GC_CALL GC_print_trace(word gc_no)
  * and scans the entire region immediately, in case the contents
  * change.
  */
+GC_ATTR_NO_SANITIZE_ADDR GC_ATTR_NO_SANITIZE_MEMORY
 GC_API void GC_CALL GC_push_all_eager(char *bottom, char *top)
-                        GC_ATTR_NO_SANITIZE_ADDR GC_ATTR_NO_SANITIZE_MEMORY
 {
     word * b = (word *)(((word) bottom + ALIGNMENT-1) & ~(ALIGNMENT-1));
     word * t = (word *)(((word) top) & ~(ALIGNMENT-1));
@@ -1604,9 +1604,9 @@ GC_INNER void GC_push_all_stack(ptr_t bottom, ptr_t top)
 
 #if defined(WRAP_MARK_SOME) && defined(PARALLEL_MARK)
   /* Similar to GC_push_conditional but scans the whole region immediately. */
+  GC_ATTR_NO_SANITIZE_ADDR GC_ATTR_NO_SANITIZE_MEMORY
   GC_INNER void GC_push_conditional_eager(ptr_t bottom, ptr_t top,
                                           GC_bool all)
-                        GC_ATTR_NO_SANITIZE_ADDR GC_ATTR_NO_SANITIZE_MEMORY
   {
     word * b = (word *)(((word) bottom + ALIGNMENT-1) & ~(ALIGNMENT-1));
     word * t = (word *)(((word) top) & ~(ALIGNMENT-1));