Skip to content
Snippets Groups Projects
Commit 7958d685 authored by Christian Humer's avatar Christian Humer
Browse files

Fix missing check for vector length in delete list.

parent 6b901967
Branches
No related tags found
No related merge requests found
...@@ -555,19 +555,21 @@ final class CachedReplaceVectorNode extends CachedVectorNode { ...@@ -555,19 +555,21 @@ final class CachedReplaceVectorNode extends CachedVectorNode {
} }
int resultIndex = 0; int resultIndex = 0;
for (int i = 0; i < vectorLength; i++) { if (resultLength > 0) {
Object element = vector.getDataAtAsObject(i); for (int i = 0; i < vectorLength; i++) {
if (element != DELETE_MARKER) { Object element = vector.getDataAtAsObject(i);
data[resultIndex] = element; if (element != DELETE_MARKER) {
if (hasNames) { data[resultIndex] = element;
newNames[resultIndex] = names.getDataAt(i); if (hasNames) {
} newNames[resultIndex] = names.getDataAt(i);
resultIndex++; }
if (isPreviousResultSpecialized() && resultIndex > resultLength) { resultIndex++;
// got too many elements if (isPreviousResultSpecialized() && resultIndex > resultLength) {
CompilerDirectives.transferToInterpreterAndInvalidate(); // got too many elements
previousResultLength = PREVIOUS_RESULT_GENERIC; CompilerDirectives.transferToInterpreterAndInvalidate();
return deleteElements(vector, vectorLength); previousResultLength = PREVIOUS_RESULT_GENERIC;
return deleteElements(vector, vectorLength);
}
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment