diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2014-02-03 13:30:06 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-02-04 18:28:25 +0100 |
commit | e5bd40742ab8d0b4ffc9307eb46bc41456fe394a (patch) | |
tree | c14979f7f451e90988714450607234059fa5d022 /src/qml/compiler/qv4compiler.cpp | |
parent | 48144d3b29a1204bf1820d782228fbd9e25f318e (diff) |
[new compiler] Cleanup empty string handling
Ensure that the empty string always has index 0, that simplifies the code in a
few places and makes it easier to check for the empty string in other places
where there's no access to the string pool itself.
Change-Id: Icd204aec478e8350ef3fee75d89bda1f88cffe26
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/compiler/qv4compiler.cpp')
-rw-r--r-- | src/qml/compiler/qv4compiler.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/qml/compiler/qv4compiler.cpp b/src/qml/compiler/qv4compiler.cpp index 7fb10d5f42..bc47b815f2 100644 --- a/src/qml/compiler/qv4compiler.cpp +++ b/src/qml/compiler/qv4compiler.cpp @@ -53,6 +53,8 @@ QV4::Compiler::JSUnitGenerator::JSUnitGenerator(QQmlJS::V4IR::Module *module, in if (headerSize == -1) headerSize = sizeof(QV4::CompiledData::Unit); this->headerSize = headerSize; + // Make sure the empty string always gets index 0 + registerString(QString()); } int QV4::Compiler::JSUnitGenerator::registerString(const QString &str) |