Skip to content

Commit

Permalink
uninitialized pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
Diogo Netto authored and Diogo Netto committed Nov 15, 2022
1 parent fa0894c commit f594a8d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/gc-debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ static void gc_verify_track(jl_ptls_t ptls)
clear_mark(GC_CLEAN);
gc_mark_queue_all_roots(ptls, &mq);
gc_mark_finlist(&mq, &to_finalize, 0);
for (int i = 0;i < jl_n_threads;i++) {
for (int i = 0; i < gc_n_threads;i++) {
jl_ptls_t ptls2 = gc_all_tls_states[i];
gc_mark_finlist(&mq, &ptls2->finalizers, 0);
}
Expand Down Expand Up @@ -256,7 +256,7 @@ void gc_verify(jl_ptls_t ptls)
gc_verifying = 1;
gc_mark_queue_all_roots(ptls, &mq);
gc_mark_finlist(&mq, &to_finalize, 0);
for (int i = 0;i < jl_n_threads;i++) {
for (int i = 0; i < gc_n_threads;i++) {
jl_ptls_t ptls2 = gc_all_tls_states[i];
gc_mark_finlist(&mq, &ptls2->finalizers, 0);
}
Expand Down
24 changes: 12 additions & 12 deletions src/gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1877,8 +1877,8 @@ STATIC_INLINE jl_value_t *gc_mark_obj8(jl_ptls_t ptls, char *obj8_parent, uint8_
{
(void)jl_assume(obj8_begin < obj8_end);
jl_gc_markqueue_t *mq = &ptls->mark_queue;
jl_value_t **slot;
jl_value_t *new_obj;
jl_value_t **slot = NULL;
jl_value_t *new_obj = NULL;
for (; obj8_begin < obj8_end; obj8_begin++) {
slot = &((jl_value_t**)obj8_parent)[*obj8_begin];
new_obj = *slot;
Expand Down Expand Up @@ -1906,8 +1906,8 @@ STATIC_INLINE jl_value_t *gc_mark_obj16(jl_ptls_t ptls, char *obj16_parent, uint
{
(void)jl_assume(obj16_begin < obj16_end);
jl_gc_markqueue_t *mq = &ptls->mark_queue;
jl_value_t **slot;
jl_value_t *new_obj;
jl_value_t **slot = NULL;
jl_value_t *new_obj = NULL;
for (; obj16_begin < obj16_end; obj16_begin++) {
slot = &((jl_value_t**)obj16_parent)[*obj16_begin];
new_obj = *slot;
Expand Down Expand Up @@ -1935,8 +1935,8 @@ STATIC_INLINE jl_value_t *gc_mark_obj32(jl_ptls_t ptls, char *obj32_parent, uint
{
(void)jl_assume(obj32_begin < obj32_end);
jl_gc_markqueue_t *mq = &ptls->mark_queue;
jl_value_t **slot;
jl_value_t *new_obj;
jl_value_t **slot = NULL;
jl_value_t *new_obj = NULL;
for (; obj32_begin < obj32_end; obj32_begin++) {
slot = &((jl_value_t**)obj32_parent)[*obj32_begin];
new_obj = *slot;
Expand Down Expand Up @@ -2630,27 +2630,27 @@ static void gc_queue_thread_local(jl_gc_markqueue_t *mq, jl_ptls_t ptls2)
jl_task_t *task;
task = ptls2->root_task;
if (task != NULL) {
gc_try_claim_and_push(mq, task, NULL);
gc_heap_snapshot_record_root((jl_value_t*)task, "root task");
gc_try_claim_and_push(mq, task, NULL);
}
task = jl_atomic_load_relaxed(&ptls2->current_task);
if (task != NULL) {
gc_try_claim_and_push(mq, task, NULL);
gc_heap_snapshot_record_root((jl_value_t*)task, "current task");
gc_try_claim_and_push(mq, task, NULL);
}
task = ptls2->next_task;
if (task != NULL) {
gc_try_claim_and_push(mq, task, NULL);
gc_heap_snapshot_record_root((jl_value_t*)task, "next task");
gc_try_claim_and_push(mq, task, NULL);
}
task = ptls2->previous_task;
if (task != NULL) {
gc_try_claim_and_push(mq, task, NULL);
gc_heap_snapshot_record_root((jl_value_t*)task, "previous task");
gc_try_claim_and_push(mq, task, NULL);
}
if (ptls2->previous_exception) {
gc_try_claim_and_push(mq, ptls2->previous_exception, NULL);
gc_heap_snapshot_record_root((jl_value_t*)ptls2->previous_exception, "previous exception");
gc_try_claim_and_push(mq, ptls2->previous_exception, NULL);
}
}

Expand Down Expand Up @@ -3220,7 +3220,7 @@ void gc_mark_queue_all_roots(jl_ptls_t ptls, jl_gc_markqueue_t *mq)
assert(gc_n_threads);
for (size_t i = 0; i < gc_n_threads; i++) {
jl_ptls_t ptls2 = gc_all_tls_states[i];
if (ptls2)
if (ptls2 != NULL)
gc_queue_thread_local(mq, ptls2);
}
gc_mark_roots(mq);
Expand Down

0 comments on commit f594a8d

Please sign in to comment.