aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@acm.org>2021-01-19 11:31:57 -0800
committerNathan Sidwell <nathan@acm.org>2021-01-19 11:37:03 -0800
commit6e6f3ed47e5cb575819f8253e42313664b89b042 (patch)
treec4aab6509d3f384e5689b66d6de8bbc899d4afdb /gcc
parent6a2a38620cf178b53b217051f32d1d7bbba86fc9 (diff)
downloadgcc-6e6f3ed47e5cb575819f8253e42313664b89b042.zip
gcc-6e6f3ed47e5cb575819f8253e42313664b89b042.tar.gz
gcc-6e6f3ed47e5cb575819f8253e42313664b89b042.tar.bz2
c++: Fix null this pointer [PR 98624]
There's no need for this function to have an object, so make it static and avoid UB. PR c++/98624 gcc/cp/ * module.cc (trees_out::write_location): Make static.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/module.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc
index 1fd0bcf..3b224b6 100644
--- a/gcc/cp/module.cc
+++ b/gcc/cp/module.cc
@@ -3727,7 +3727,7 @@ class GTY((chain_next ("%h.parent"), for_user)) module_state {
static cpp_macro *deferred_macro (cpp_reader *, location_t, cpp_hashnode *);
public:
- void write_location (bytes_out &, location_t);
+ static void write_location (bytes_out &, location_t);
location_t read_location (bytes_in &) const;
public: