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:
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.