mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-22 16:14:10 -08:00
C backend: fix array of of bounds access in fibers
This commit is contained in:
parent
8cd96d2da2
commit
87656a3e9a
|
@ -81,7 +81,7 @@ public class Fiber {
|
|||
public void push(double value) {
|
||||
if (doubleValues == null) {
|
||||
doubleValues = new double[4];
|
||||
} else if (doubleTop + 4 == doubleValues.length) {
|
||||
} else if (doubleTop + 1 == doubleValues.length) {
|
||||
doubleValues = Arrays.copyOf(doubleValues, doubleValues.length * 3 / 2);
|
||||
}
|
||||
doubleValues[doubleTop++] = value;
|
||||
|
@ -90,7 +90,7 @@ public class Fiber {
|
|||
public void push(Object value) {
|
||||
if (objectValues == null) {
|
||||
objectValues = new Object[4];
|
||||
} else if (objectTop + 4 == objectValues.length) {
|
||||
} else if (objectTop + 1 == objectValues.length) {
|
||||
objectValues = Arrays.copyOf(objectValues, objectValues.length * 3 / 2);
|
||||
}
|
||||
objectValues[objectTop++] = value;
|
||||
|
|
Loading…
Reference in New Issue
Block a user