- 
    
Bug
 - 
    Resolution: Done
 - 
    
P2: Important
 - 
    4.8.5, 5.2.1
 - 
    Windows 7
 
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.
| For Gerrit Dashboard: QTBUG-37317 | ||||||
|---|---|---|---|---|---|---|
| # | Subject | Branch | Project | Status | CR | V | 
| 80549,1 | Fix recursive calling of QScriptProgram | stable | qt/qtscript | Status: MERGED | +2 | 0 | 
| 80634,1 | Fix recursive calling of QScriptProgram | 4.8 | qt/qt | Status: MERGED | +2 | 0 |