aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/jsruntime')
-rw-r--r--src/qml/jsruntime/qv4alloca_p.h2
-rw-r--r--src/qml/jsruntime/qv4script.cpp1
2 files changed, 2 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4alloca_p.h b/src/qml/jsruntime/qv4alloca_p.h
index 1e9f83a90e..65c3e4d65a 100644
--- a/src/qml/jsruntime/qv4alloca_p.h
+++ b/src/qml/jsruntime/qv4alloca_p.h
@@ -89,7 +89,7 @@ public:
Qt_AllocaWrapper() { m_data = 0; }
~Qt_AllocaWrapper() { free(m_data); }
void *data() { return m_data; }
- void allocate(int size) { m_data = malloc(size); }
+ void allocate(int size) { m_data = malloc(size); memset(m_data, 0, size); }
private:
void *m_data;
};
diff --git a/src/qml/jsruntime/qv4script.cpp b/src/qml/jsruntime/qv4script.cpp
index f80db86be5..7bbef3335e 100644
--- a/src/qml/jsruntime/qv4script.cpp
+++ b/src/qml/jsruntime/qv4script.cpp
@@ -241,6 +241,7 @@ Script *Script::createFromFileOrCache(ExecutionEngine *engine, QmlContext *qmlCo
QmlIR::Document::removeScriptPragmas(sourceCode);
auto result = new QV4::Script(engine, qmlContext, /*parseAsBinding*/false, sourceCode, originalUrl.toString());
+ result->contextType = QV4::Compiler::ContextType::ScriptImportedByQML;
result->parse();
return result;
}