c++: Fix null this pointer [PR 98624]

2021-01-21 Thread Nathan Sidwell
One maynot usea null this pointer to invoke astatic member function. Thisfixes 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):Chec

c++: Fix null this pointer [PR 98624]

2021-01-19 Thread Nathan Sidwell
There's no need for this function to have an object, so make it static and avoid UB. gcc/cp/ * module.cc (trees_out::write_location): Make static. -- Nathan Sidwell diff --git i/gcc/cp/module.cc w/gcc/cp/module.cc index 1fd0bcfe3eb..3b224b616c1 100644 --- i/gcc/cp/module.cc +++