From: Arthur Cohen <arthur.co...@embecosm.com>

Hi everyone,

We noticed inconsistent errors when running name-resolution 2.0 on
certain files, where an invalid error was triggered and the message was
from the `funny_ice` error finalizer function we had added as an easter
egg. We realized yesterday that the undefined value was actually our
`funny_error` boolean, which is supposed to be set only when resolving
specific easter eggs `AST::IdentifierExpr`s.

Since `funny_error` is a boolean, it does not get default-initialized in
the constructor of `Late` - which this patch corrects.

I will be pushing it to trunk directly, but this email specifically
concerns its port into 15.2.

Thanks a lot to Marc Poulhiès and Owen Avery for their help in
discovering and fixing this.

Best,

Arthur

gcc/rust/ChangeLog:

        * resolve/rust-late-name-resolver-2.0.cc (Late::Late): False initialize 
the
        funny_error field.
---
 gcc/rust/resolve/rust-late-name-resolver-2.0.cc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gcc/rust/resolve/rust-late-name-resolver-2.0.cc 
b/gcc/rust/resolve/rust-late-name-resolver-2.0.cc
index 5f215db0a72..f46f9e7dd3e 100644
--- a/gcc/rust/resolve/rust-late-name-resolver-2.0.cc
+++ b/gcc/rust/resolve/rust-late-name-resolver-2.0.cc
@@ -33,7 +33,9 @@
 namespace Rust {
 namespace Resolver2_0 {
 
-Late::Late (NameResolutionContext &ctx) : DefaultResolver (ctx) {}
+Late::Late (NameResolutionContext &ctx)
+  : DefaultResolver (ctx), funny_error (false)
+{}
 
 static NodeId
 next_node_id ()
-- 
2.49.0

Reply via email to