Skip to content

Commit d903cb1

Browse files
committed
Fix test temp path and vm allocation in tests
1 parent b2057f1 commit d903cb1

3 files changed

Lines changed: 87 additions & 58 deletions

File tree

src/Engine/ECS/scriptregistry.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,15 +100,17 @@ namespace pg
100100

101101
std::string ScriptRegistry::compile(const std::string& sourcePath, const std::string& compiledPath, StandardSystemImpl* sysCtx)
102102
{
103-
VM compiler;
104-
ecsRef->setupVm(compiler);
103+
// The VM embeds a multi-megabyte value stack, which overflows the
104+
// 1 MB default thread stack on Windows — it must live on the heap.
105+
auto compiler = std::make_unique<VM>();
106+
ecsRef->setupVm(*compiler);
105107

106108
if (sysCtx)
107109
{
108-
compiler.addNativeModule("sys", SystemModule{sysCtx});
110+
compiler->addNativeModule("sys", SystemModule{sysCtx});
109111
}
110112

111-
auto result = compiler.interpretFromFile(sourcePath, true, compiledPath);
113+
auto result = compiler->interpretFromFile(sourcePath, true, compiledPath);
112114

113115
if (result != InterpretResult::OK)
114116
{

0 commit comments

Comments
 (0)