Skip to content

Commit

Permalink
Fix unportable sizeof in roots.c
Browse files Browse the repository at this point in the history
sizeof(MVMCollectable*) is the same as sizeof(MVMCollectable**)
generally, but not guarenteed by C standard. Detected by Coverity scan.
  • Loading branch information
samcv committed May 31, 2018
1 parent 212e417 commit a0eb65b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/gc/roots.c
Expand Up @@ -272,7 +272,7 @@ void MVM_gc_root_gen2_add(MVMThreadContext *tc, MVMCollectable *c) {
if (tc->num_gen2roots == tc->alloc_gen2roots) {
tc->alloc_gen2roots *= 2;
tc->gen2roots = MVM_realloc(tc->gen2roots,
sizeof(MVMCollectable **) * tc->alloc_gen2roots);
sizeof(MVMCollectable *) * tc->alloc_gen2roots);
}

/* Add this one to the list. */
Expand Down

0 comments on commit a0eb65b

Please sign in to comment.