Details
-
Bug
-
Resolution: Done
-
P2: Important
-
4.8.5, 5.2.1
-
Windows 7
Description
Crash happens in debug mode if QScriptEngine::evaluate(program(script)) is called. But works fine if calling with the same script other evaluate function QScriptEngine::evaluate(script).
Crash happens in ASSERT located here:
.\src\3rdparty\javascriptcore\JavaScriptCore\runtime\Executable.cpp
JSObject* EvalExecutable::compile(ExecState* exec, ScopeChainNode* scopeChainNode) { ... ASSERT(!m_evalCodeBlock); ... }
Looks like Executable instance is re-used when running program and m_evalCodeBlock not cleaned causing crash. So in release mode new m_evalCodeBlock is just allocated and possibly leaks memory. When running plain script Executable is re-created.
Easy to reproduce with the attached example in debug mode.
1. Enter a number > 0 in the first spin box.
2. Hit Calc
3. -> program counts up
=> no crash
Do the same with checkbox "Use Program" enabled => ASSERT at first recursion.