Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Unity-Technologies/bdwgc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2018-09-05 00:45:41 +0300
committerJosh Peterson <joshuap@unity3d.com>2019-12-03 19:53:26 +0300
commitef0b12fb47c50db58ba80895f1a60ffc8caa7ab8 (patch)
tree2b1d27bb8a4f04583bd982dcf3805187beb867f7
parent14de1320966a2f16ad6d6b0ddc3b869f7d890204 (diff)
Really fix 'potential unsafe sign check of a bitwise operation' code defect
(fix of commit af00c4d) * mark.c [!OS2] (GC_mark_from): Replace (signed_word)v>=0 to (v&SIGNB)==0 (anyway, the compiler generates the same code).
-rw-r--r--mark.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/mark.c b/mark.c
index 06a1a53e..72fdec6a 100644
--- a/mark.c
+++ b/mark.c
@@ -664,7 +664,8 @@ GC_INNER mse * GC_mark_from(mse *mark_stack_top, mse *mark_stack,
# ifdef OS2 /* Use untweaked version to circumvent compiler problem */
while ((word)mark_stack_top >= (word)mark_stack && credit >= 0)
# else
- while ((((ptr_t)mark_stack_top - (ptr_t)mark_stack) | credit) >= 0)
+ while (((((word)mark_stack_top - (word)mark_stack) | (word)credit)
+ & SIGNB) == 0)
# endif
{
current_p = mark_stack_top -> mse_start;