Fix potential overflow in decrement when computing GC_markers_m1
authorIvan Maidanski <ivmai@mail.ru>
Fri, 30 Sep 2016 14:12:24 +0000 (17:12 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Fri, 30 Sep 2016 14:12:24 +0000 (17:12 +0300)
commit160fab240e19a5cb4eac264a8e05d75ff45d3473
tree33176348a6be857392023631123606b90de3cc9b
parentd1cdea89a713b5c3da886911826a84ef3feb432f
Fix potential overflow in decrement when computing GC_markers_m1

Also, call WARN if a non-positive value is specified in GC_MARKERS.

* pthread_support.c [PARALLEL_MARK] (GC_thr_init): Replace markers_m1
local variable with markers one; keep real number of markers in
"markers" variable (not a decremented one); treat invalid (i.e.
non-positive) markers value (obtained from GC_MARKERS environment
variable) the same way as too big ones (i.e. set to maximum number of
markers in this case); adjust WARN message accordingly; report invalid
or too big markers value in WARN.
* win32_threads.c [PARALLEL_MARK] (GC_thr_init): Likewise.
* pthread_support.c [PARALLEL_MARK] (GC_thr_init): Adjust code
indentation.
pthread_support.c
win32_threads.c