Skip to content

Commit

Permalink
Fix pointer comparison in mechanism that delays reclamation in case of
Browse files Browse the repository at this point in the history
collision with current stack variables.
  • Loading branch information
Victor Bandur committed Mar 1, 2017
1 parent 5b9f590 commit 99f34db
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion c/vdmclib/src/main/VdmGC.c
Expand Up @@ -174,7 +174,7 @@ void vdm_gc()
//Check that there is no interference between this call's stack
//variables and the reference to the memory we are freeing.
//If there is, then postpone reclamation to a later pass.
if(!((current->loc->ref_from == (TVP *)(&tmp)) || ((void *)(current->loc->ref_from) == (void *)&current) || (current->loc->ref_from == (TVP *)&tmp_loc)))
if(!(((void *)(current->loc->ref_from) == (void *)(&tmp)) || ((void *)(current->loc->ref_from) == (void *)&current) || (current->loc->ref_from == &tmp_loc)))
{
//For compatibility with vdmFree().
*(current->loc->ref_from) = NULL;
Expand Down

0 comments on commit 99f34db

Please sign in to comment.