1.1 --- a/jitcraft/BytecodeCompiler.cpp Wed Jun 27 20:44:27 2012 -0700
1.2 +++ b/jitcraft/BytecodeCompiler.cpp Wed Jun 27 22:02:40 2012 -0700
1.3 @@ -147,7 +147,12 @@
1.4 index->right()->accept(this);
1.5 __ bounds_sta();
1.6 node->expression()->accept(this);
1.7 - __ setarray_i();
1.8 + if (index->left()->type()->contained()->isFloat()) {
1.9 + __ setarray_f();
1.10 + } else {
1.11 + assert(index->left()->type()->contained()->isInt());
1.12 + __ setarray_i();
1.13 + }
1.14 }
1.15 }
1.16
1.17 @@ -178,10 +183,14 @@
1.18 node->right()->accept(this);
1.19 __ bounds_sta();
1.20
1.21 - if (node->type()->isArray())
1.22 + if (node->type()->isArray()) {
1.23 __ getarray_p();
1.24 - else
1.25 + } else if (node->type()->isFloat()) {
1.26 + __ getarray_f();
1.27 + } else {
1.28 __ getarray_i();
1.29 + assert(node->type()->isInt());
1.30 + }
1.31 }
1.32
1.33 void