Pushed to the gcc-15 branch today.

Thanks,

Arthur

On 4/29/25 9:20 AM, arthur.co...@embecosm.com wrote:
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 ()

--
Arthur Cohen <arthur.co...@embecosm.com>

Toolchain Engineer

Embecosm GmbH

Geschäftsführer: Jeremy Bennett
Niederlassung: Nürnberg
Handelsregister: HR-B 36368
www.embecosm.de

Fürther Str. 27
90429 Nürnberg


Tel.: 091 - 128 707 040
Fax: 091 - 128 707 077

Attachment: OpenPGP_0x1B3465B044AD9C65.asc
Description: OpenPGP public key

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

Reply via email to