Skip to content

Commit

Permalink
Remove NULL check for Self() in TreeTop::join
Browse files Browse the repository at this point in the history
`OMR::TreeTop::join()` checks if self() is NULL [1], which is odd
because it never makes sense to call a member function on a NULL
object. Such calls are undefined behaviour.

Closes: #4835
Signed-off-by: Tucker <tuckermiles70@gmail.com>
  • Loading branch information
tuckermiles70 committed Feb 19, 2020
1 parent 6d76bf2 commit 82289e7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions compiler/il/OMRTreeTop_inlines.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ OMR::TreeTop::unlink(bool decRefCountRecursively)
inline void
OMR::TreeTop::join(TR::TreeTop * p)
{
if (self())
self()->setNextTreeTop(p);
self()->setNextTreeTop(p);

if (p)
p->setPrevTreeTop(self());
}
Expand Down

0 comments on commit 82289e7

Please sign in to comment.