diff options
Diffstat (limited to 'src/qml/compiler/qv4codegen.cpp')
-rw-r--r-- | src/qml/compiler/qv4codegen.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/qml/compiler/qv4codegen.cpp b/src/qml/compiler/qv4codegen.cpp index 185f1812f7..0d004bfe80 100644 --- a/src/qml/compiler/qv4codegen.cpp +++ b/src/qml/compiler/qv4codegen.cpp @@ -816,7 +816,10 @@ bool Codegen::visit(ExportDeclaration *ast) } exportedValue.loadInAccumulator(); - Reference defaultExportSlot = Reference::fromScopedLocal(this, 0, /*scope*/0); + + const int defaultExportIndex = _context->locals.indexOf(_context->localNameForDefaultExport); + Q_ASSERT(defaultExportIndex != -1); + Reference defaultExportSlot = Reference::fromScopedLocal(this, defaultExportIndex, /*scope*/0); defaultExportSlot.storeConsumeAccumulator(); return false; |