Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion lib/Backend/NativeCodeGenerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ void SetProfileMode(BOOL fSet);
: JsUtil::WaitableJobManager(processor)
, autoClose(true)
, isClosed(false)
, processed(false)
{
Processor()->AddManager(this);
}
Expand Down Expand Up @@ -238,7 +239,7 @@ void SetProfileMode(BOOL fSet);

FreeLoopBodyJob* GetJob(FreeLoopBodyJob* job)
{
return job;
return this->processed ? nullptr : job;
}

bool WasAddedToJobProcessor(JsUtil::Job *const job) const
Expand Down Expand Up @@ -268,6 +269,8 @@ void SetProfileMode(BOOL fSet);
{
FreeLoopBodyJob* freeLoopBodyJob = static_cast<FreeLoopBodyJob*>(job);

this->processed = true;

if (freeLoopBodyJob->heapAllocated)
{
HeapDelete(freeLoopBodyJob);
Expand All @@ -280,6 +283,7 @@ void SetProfileMode(BOOL fSet);
NativeCodeGenerator* nativeCodeGen;
bool autoClose;
bool isClosed;
bool processed;
};

FreeLoopBodyJobManager freeLoopBodyManager;
Expand Down