c++: Fix null this pointer [PR 98624]
authorNathan Sidwell <nathan@acm.org>
Thu, 21 Jan 2021 18:37:23 +0000 (10:37 -0800)
committerNathan Sidwell <nathan@acm.org>
Thu, 21 Jan 2021 18:41:35 +0000 (10:41 -0800)
commit7944753fad501194eb8a828d6b74270e79d14a4d
tree9647dba777aff2103672565f22337af0ff37d769
parent0fb7aa205afebe178c06683037ccd4c41104337a
c++: Fix null this pointer [PR 98624]

One may not use a null this pointer to invoke a static member
function.  This fixes the remaining ubsan errors found with an
ubsan bootstrap.

PR c++/98624
gcc/cp/
* module.cc (depset::hash::find_dependencies): Add
module arg.
(trees_out::core_vals): Check state before calling
write_location.
(sort_cluster, module_state::write): Adjust
find_dependencies call.
gcc/cp/module.cc