Changeset: bd70bb6ad416 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=bd70bb6ad416
Modified Files:
MonetDB5/src/modules/kernel/bat5.mx
Branch: Oct2010
Log Message:
Don't access the value *at* BUNlast, but only the values before it.
Errors found by valgrind.
diffs (36 lines):
diff -r fb30bb606cb2 -r bd70bb6ad416 MonetDB5/src/modules/kernel/bat5.mx
--- a/MonetDB5/src/modules/kernel/bat5.mx Sat Oct 09 13:33:31 2010 +0200
+++ b/MonetDB5/src/modules/kernel/bat5.mx Sat Oct 09 13:34:25 2010 +0200
@@ -3822,8 +3822,8 @@
@1 *r = (@1*)Tloc(bn, BUNfirst(bn));
for (;p<q; oidx++, p++) {
- if ( *o == oidx ){
- o += (o < ol);
+ if ( o < ol && *o == oidx ){
+ o++;
} else {
cnt++;
*r++ = *p;
@@ -3951,8 +3951,8 @@
BATaccessBegin(d, USE_TAIL, MMAP_SEQUENTIAL);
for (;oidx<lim; oidx++) {
- if ( *o == oidx ){
- o += (o < ol);
+ if ( o < ol && *o == oidx ){
+ o++;
} else {
*r++ = oidx;
}
@@ -4106,9 +4106,8 @@
BATaccessBegin(d, USE_TAIL, MMAP_SEQUENTIAL);
for (;oidx<bidx; oidx++) {
if ( *o == oidx ){
- while ( *ol == bidx && ol>o) {
+ while ( ol > o && *--ol == bidx) {
bidx--;
- ol--;
}
*r++ = bidx;
o += (o < ol);
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list