mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 03:20:18 +00:00
some fix
This commit is contained in:
parent
c07bf67714
commit
96eaeb49f5
@ -45,6 +45,7 @@
|
||||
#define PK_DEBUG_NO_MEMORY_POOL 0
|
||||
#define PK_DEBUG_NO_AUTO_GC 0
|
||||
#define PK_DEBUG_GC_STATS 0
|
||||
#define PK_DEBUG_PRECOMPILED_EXEC 0
|
||||
|
||||
/*************** internal settings ***************/
|
||||
|
||||
|
@ -159,10 +159,11 @@ namespace pkpy{
|
||||
PyObject* VM::exec(std::string_view source, Str filename, CompileMode mode, PyObject* _module){
|
||||
if(_module == nullptr) _module = _main;
|
||||
try {
|
||||
CodeObject_ code = compile(source, filename, mode);
|
||||
#if PK_DEBUG_DIS_EXEC
|
||||
if(_module == _main) std::cout << disassemble(code) << '\n';
|
||||
#if PK_DEBUG_PRECOMPILED_EXEC == 1
|
||||
Str precompiled = vm->precompile(source, filename, mode);
|
||||
source = precompiled.sv();
|
||||
#endif
|
||||
CodeObject_ code = compile(source, filename, mode);
|
||||
return _exec(code, _module);
|
||||
}catch (const Exception& e){
|
||||
stderr_write(e.summary() + "\n");
|
||||
|
Loading…
x
Reference in New Issue
Block a user