diff options
author | Philip Herron <herron.philip@googlemail.com> | 2023-04-17 20:48:41 +0100 |
---|---|---|
committer | Philip Herron <philip.herron@embecosm.com> | 2023-04-26 15:02:40 +0000 |
commit | 04fad308c62f619b6002f290dc72bcd9747a911c (patch) | |
tree | 7b3b942c631e2cced17cd3aebfc34104312972d2 /gcc/objc/objc-runtime-hooks.h | |
parent | e70fbab606bdfa858d5993eddbc9d8070914a139 (diff) | |
download | gcc-04fad308c62f619b6002f290dc72bcd9747a911c.zip gcc-04fad308c62f619b6002f290dc72bcd9747a911c.tar.gz gcc-04fad308c62f619b6002f290dc72bcd9747a911c.tar.bz2 |
gccrs: Fix memory corruption at peek_context
When working in the resolve_operator_overload it was found that we got
memory corruption as method resolution will use the query system and
therefore resolve new methods and the current function context info will
change and due to the fact the peek_context interface returns a reference
to the element which was now safe from a vector which can change and all
you need is the current function context at that moment in time.
gcc/rust/ChangeLog:
* typecheck/rust-autoderef.cc: don't take a reference
* typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): likewise
* typecheck/rust-hir-type-check.h: remove reference
* typecheck/rust-typecheck-context.cc (TypeCheckContext::pop_return_type): likewise
Signed-off-by: Philip Herron <herron.philip@googlemail.com>
Diffstat (limited to 'gcc/objc/objc-runtime-hooks.h')
0 files changed, 0 insertions, 0 deletions