Skip to content

Commit 524b57a

Browse files
committed
Correct use of fEntryOffset
1 parent 51e3a66 commit 524b57a

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

scripts/JSRootIOEvolution.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@
239239
this.fObjectMap = {};
240240
this.fClassMap = {};
241241
this.fObjectMap[0] = null;
242+
this.fDisplacement = 0;
242243
}
243244

244245
JSROOT.TBuffer.prototype.ReadVersion = function() {
@@ -2084,7 +2085,7 @@
20842085
member.read_version = function(buf, cnt) {
20852086
// read version, check member-wise flag; if any, read version for contained object
20862087

2087-
console.log('start reading version', buf.o, buf.remain(), 'cnt', cnt, 'read_empty', this.read_empty_stl_version);
2088+
// console.log('start reading version', buf.o, buf.remain(), 'cnt', cnt, 'read_empty', this.read_empty_stl_version);
20882089

20892090
// workaround - in some cases version is not written for empty container
20902091
if ((cnt===0) && ((buf.remain()<6) || this.read_empty_stl_version === false)) {

scripts/JSRootTree.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1414,9 +1414,9 @@
14141414
if (this.basket.fEntryOffset) {
14151415
off = this.basket.fEntryOffset[shift];
14161416
} else {
1417-
off = this.basket.fNevBufSize * shift;
1417+
off = this.basket.fKeylen + this.basket.fNevBufSize * shift;
14181418
}
1419-
this.raw.locate((this.raw.entry_shift || 0) + off);
1419+
this.raw.locate(off - this.raw.raw_shift);
14201420
},
14211421
GetTarget : function(tgtobj) {
14221422
if (!this.tgt) return tgtobj;
@@ -2052,6 +2052,9 @@
20522052
basket.fEntryOffset = buf.ReadFastArray(buf.ntoi4(), JSROOT.IO.kInt);
20532053
if (!basket.fEntryOffset) basket.fEntryOffset = [ basket.fKeylen ];
20542054

2055+
console.log(basket.fKeylen, 'READ fEntryOffset', basket.fEntryOffset.length, basket.fNevBuf);
2056+
for (var k=0;k<20;++k) console.log('k',k,'off',basket.fEntryOffset[k]);
2057+
20552058
if (buf.remain() > 0)
20562059
basket.fDisplacement = buf.ReadFastArray(buf.ntoi4(), JSROOT.IO.kInt);
20572060

@@ -2087,8 +2090,6 @@
20872090
if (basket.fKeylen + basket.fObjlen === basket.fNbytes) {
20882091
// use data from original blob
20892092
buf.raw_shift = 0;
2090-
buf.entry_shift = basket.fKeylen;
2091-
20922093
} else {
20932094
// unpack data and create new blob
20942095
var objblob = JSROOT.R__unzip(blob, basket.fObjlen, false, buf.o);

0 commit comments

Comments
 (0)