Fix a long standing bug within dvmHeapSourceGetObjectBitmaps. All
callers of this function assign the return value to an unsigned value
even though this function returns -1 in the error case. This causes
the error checks to succeed in cases where it should otherwise fail.
Rather than return -1 on error, I have elected to return 0 instead
which just happens to be compatible with all current uses.
diff --git a/vm/alloc/MarkSweep.c b/vm/alloc/MarkSweep.c
index 6f41f88..78286cf 100644
--- a/vm/alloc/MarkSweep.c
+++ b/vm/alloc/MarkSweep.c
@@ -146,7 +146,7 @@
numBitmaps = dvmHeapSourceGetObjectBitmaps(objectBitmaps,
HEAP_SOURCE_MAX_HEAP_COUNT);
- if (numBitmaps <= 0) {
+ if (numBitmaps == 0) {
return false;
}