Skip to content

Commit

Permalink
[Truffle] Missing some guards in the array builder.
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisseaton committed Feb 27, 2015
1 parent 5166bff commit 5c499a7
Showing 1 changed file with 3 additions and 3 deletions.
Expand Up @@ -225,7 +225,7 @@ public Object append(Object store, int index, RubyArray array) {
@Override
public Object append(Object store, int index, Object value) {
// TODO(CS): inject probability
if (value instanceof Integer) {
if (store instanceof int[] && value instanceof Integer) {
((int[]) store)[index] = (int) value;
return store;
} else {
Expand Down Expand Up @@ -297,7 +297,7 @@ public Object append(Object store, int index, RubyArray array) {
@Override
public Object append(Object store, int index, Object value) {
// TODO(CS): inject probability
if (value instanceof Long) {
if (store instanceof long[] && value instanceof Long) {
((long[]) store)[index] = (long) value;
return store;
} else if (value instanceof Integer) {
Expand Down Expand Up @@ -362,7 +362,7 @@ public Object append(Object store, int index, RubyArray array) {
@Override
public Object append(Object store, int index, Object value) {
// TODO(CS): inject probability
if (value instanceof Double) {
if (store instanceof double[] && value instanceof Double) {
((double[]) store)[index] = (double) value;
return store;
} else {
Expand Down

0 comments on commit 5c499a7

Please sign in to comment.