Skip to content

Commit

Permalink
Fix memory tracing error in AsyncGeneratorObject
Browse files Browse the repository at this point in the history
* fix to trace ExecutionPauser and AsyncGeneratorQueue vector members correctly

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
  • Loading branch information
clover2123 authored and bbrto21 committed Jun 4, 2020
1 parent 6bfa3f9 commit bdd03a2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/runtime/AsyncGeneratorObject.h
Expand Up @@ -90,6 +90,10 @@ class AsyncGeneratorObject : public Object {
GC_set_bit(desc, GC_WORD_OFFSET(AsyncGeneratorObject, m_executionPauser.m_registerFile));
GC_set_bit(desc, GC_WORD_OFFSET(AsyncGeneratorObject, m_executionPauser.m_byteCodeBlock));
GC_set_bit(desc, GC_WORD_OFFSET(AsyncGeneratorObject, m_executionPauser.m_resumeValue));
GC_set_bit(desc, GC_WORD_OFFSET(AsyncGeneratorObject, m_executionPauser.m_promiseCapability.m_promise));
GC_set_bit(desc, GC_WORD_OFFSET(AsyncGeneratorObject, m_executionPauser.m_promiseCapability.m_resolveFunction));
GC_set_bit(desc, GC_WORD_OFFSET(AsyncGeneratorObject, m_executionPauser.m_promiseCapability.m_rejectFunction));
GC_set_bit(desc, GC_WORD_OFFSET(AsyncGeneratorObject, m_asyncGeneratorQueue));
}

friend Value asyncGeneratorEnqueue(ExecutionState& state, const Value& generator, AsyncGeneratorObject::AsyncGeneratorEnqueueType type, const Value& value);
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/ExecutionPauser.cpp
Expand Up @@ -48,8 +48,8 @@ void* ExecutionPauser::operator new(size_t size)
GC_set_bit(desc, GC_WORD_OFFSET(ExecutionPauser, m_byteCodeBlock));
GC_set_bit(desc, GC_WORD_OFFSET(ExecutionPauser, m_resumeValue));
GC_set_bit(desc, GC_WORD_OFFSET(ExecutionPauser, m_promiseCapability.m_promise));
GC_set_bit(desc, GC_WORD_OFFSET(ExecutionPauser, m_promiseCapability.m_rejectFunction));
GC_set_bit(desc, GC_WORD_OFFSET(ExecutionPauser, m_promiseCapability.m_resolveFunction));
GC_set_bit(desc, GC_WORD_OFFSET(ExecutionPauser, m_promiseCapability.m_rejectFunction));
descr = GC_make_descriptor(desc, GC_WORD_LEN(ExecutionPauser));
typeInited = true;
}
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/ExecutionPauser.h
Expand Up @@ -67,8 +67,8 @@ class ExecutionPauser : public gc {
m_byteCodeBlock = nullptr;
m_resumeValue = SmallValue();
m_promiseCapability.m_promise = nullptr;
m_promiseCapability.m_rejectFunction = nullptr;
m_promiseCapability.m_resolveFunction = nullptr;
m_promiseCapability.m_rejectFunction = nullptr;
}

enum StartFrom {
Expand Down

0 comments on commit bdd03a2

Please sign in to comment.