diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-01-03 20:45:36 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2013-01-04 06:57:01 +0100 |
commit | 8746fcc8b81a57d42d11504806556910fd4ab94d (patch) | |
tree | 95eb260f5893cf96c86f4945d087c562704fcc59 /qv4codegen.cpp | |
parent | 6340e86eb0e78cebd5d95b05b11644d9bb8b5a61 (diff) |
Correctly size arrays with trailing elisions
Change-Id: Iae09ec815e3307615299bf97741716b3671c9560
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'qv4codegen.cpp')
-rw-r--r-- | qv4codegen.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/qv4codegen.cpp b/qv4codegen.cpp index 180d1c80e1..fa23664980 100644 --- a/qv4codegen.cpp +++ b/qv4codegen.cpp @@ -997,8 +997,11 @@ bool Codegen::visit(ArrayLiteral *ast) move(subscript(_block->TEMP(t), _block->CONST(IR::NumberType, index)), *expr); ++index; } - for (Elision *elision = ast->elision; elision; elision = elision->next) - ++index; // ### set the size of the array + if (ast->elision) { + for (Elision *elision = ast->elision->next; elision; elision = elision->next) + ++index; + move(subscript(_block->TEMP(t), _block->CONST(IR::NumberType, index)), _block->CONST(IR::UndefinedType, 0)); + } _expr.code = _block->TEMP(t); return false; } |