This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: RFC: fix PR symtab/11464
On Mon, 11 Feb 2013 21:45:01 +0100, Tom Tromey wrote:
> Jan> That's true, that crashes even for me. I still expected it crashes
> Jan> for you if you remove the two lines:
> Jan> if (classification == NAME)
> Jan> break;
> Jan> which cannot / does not crash.
>
> I thought you were reporting that the test case did not crash before the
> fix.
>
> Now I don't understand what you are saying here.
It does not matter but the whole time I was trying to say this does not crash
for me:
--- ./gdb/c-exp.y-x 2013-02-11 21:53:30.837153125 +0100
+++ ./gdb/c-exp.y 2013-02-11 21:53:44.947170669 +0100
@@ -2986,8 +2986,8 @@ yylex (void)
last_was_coloncolon = 0;
- if (classification == NAME)
- break;
+// if (classification == NAME)
+// break;
context_type = yylval.tsym.type;
}
> >> I guess you are saying I should invert the if.
> >> Ok, I will do that.
>
> Jan> No, I did not mean that. In fact I do not understand much what condition
> Jan> inversion do you mean.
>
> I mean now the patch reads:
>
> if (classification != NAME)
> context_type = yylval.tsym.type;
>
> This still fixes the failing test case, but I haven't run it through a
> complete regression test yet.
In such case there should be:
if (classification != NAME)
context_type = yylval.tsym.type;
else
context_type = NULL;
Otherwise context_type could have "stale" content.
But it has no effect on the executed code.
I do not mind the patch form anymore, it was all just about the crashing /
non-crashing misunderstanding.
Thanks,
Jan