Skip to content

Commit

Permalink
Eliminate 'conditional expression is always true' code defect in GC_init
Browse files Browse the repository at this point in the history
* misc.c (GC_init): Move ALIGNMENT>GC_DS_TAGS expression from
"if" statement to #if.
  • Loading branch information
ivmai committed May 23, 2017
1 parent 0fc61f2 commit 408ea9f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1143,10 +1143,11 @@ GC_API void GC_CALL GC_init(void)
}
# endif
maybe_install_looping_handler();
/* Adjust normal object descriptor for extra allocation. */
if (ALIGNMENT > GC_DS_TAGS && EXTRA_BYTES != 0) {
GC_obj_kinds[NORMAL].ok_descriptor = ((word)(-ALIGNMENT) | GC_DS_LENGTH);
}
# if ALIGNMENT > GC_DS_TAGS
/* Adjust normal object descriptor for extra allocation. */
if (EXTRA_BYTES != 0)
GC_obj_kinds[NORMAL].ok_descriptor = (word)(-ALIGNMENT) | GC_DS_LENGTH;
# endif
GC_exclude_static_roots_inner(beginGC_arrays, endGC_arrays);
GC_exclude_static_roots_inner(beginGC_obj_kinds, endGC_obj_kinds);
# ifdef SEPARATE_GLOBALS
Expand Down

0 comments on commit 408ea9f

Please sign in to comment.