You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
while casually looking at the rather complex code of the scala.collection.immutable.Vector implementation I found some odd lines of code and one that I believe to be a bug:
in line 1196 it looks like the newIndex is supposed to be shifted by >>25 but is actually shifted by 20.
I have tried to reproduce a bug in Scala code but failed to do so. From what I understand one has to append or prepend something to a position that is more than 1<<25 positions away from the last written position. But the appendFront and appendBack methods are rather complex and stateful to the extend that I can't figure out which other conditions need to be met.
While I am at it:
There also seem to be completely redundant Array allocations in there, which are probably optimized away by the compiler's (escape analysis?), but they are redundant none the less... right?:
Hello Everyone,
while casually looking at the rather complex code of the scala.collection.immutable.Vector implementation I found some odd lines of code and one that I believe to be a bug:
in line 1196 it looks like the newIndex is supposed to be shifted by >>25 but is actually shifted by 20.
I have tried to reproduce a bug in Scala code but failed to do so. From what I understand one has to append or prepend something to a position that is more than 1<<25 positions away from the last written position. But the appendFront and appendBack methods are rather complex and stateful to the extend that I can't figure out which other conditions need to be met.
While I am at it:
There also seem to be completely redundant Array allocations in there, which are probably optimized away by the compiler's (escape analysis?), but they are redundant none the less... right?:
L1159-L1160
L1174-L1175
L1190-L1193
The text was updated successfully, but these errors were encountered: