This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix handling of discriminantless univariant enums in Rust


>>>>> "Tom" == Tom Tromey <tom@tromey.com> writes:

Tom> Also, I suspect this will wind up doing the wrong thing in the
Tom> STRUCTOP_ANONYMOUS case in rust_evaluate_subexp.  In particular I wonder
Tom> if an additional "print univariant.0.a" test will work correctly?

Oh duh, I see that this isn't a correct counter-example.
What about just "print univariant.a"?
It seems to me that this will hit this:

	    start = disr.is_encoded ? 0 : 1;

... choosing 1 here, but:

	    for (i = start; i < TYPE_NFIELDS (variant_type); i++)

... failing this because TYPE_NFIELDS == 1; and then:

	    if (i == TYPE_NFIELDS (variant_type))
	      /* We didn't find it.  */
	      error(_("Could not find field %s of struct variant %s"),

Tom


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]