[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Regression 2.0 related to symbol aliases
From: |
Paul Eggert |
Subject: |
Re: Regression 2.0 related to symbol aliases |
Date: |
Tue, 12 Apr 2005 15:41:20 -0700 |
User-agent: |
Gnus/5.1006 (Gnus v5.10.6) Emacs/21.4 (gnu/linux) |
Thanks for the bug report and test case. I installed the following
somewhat-different patch, which I hope does the trick as well:
2005-04-12 Paul Eggert <address@hidden>
* src/symtab.c (symbol_make_alias): Call symbol_type_set,
reverting the 2004-10-11 change to this function.
(symbol_check_alias_consistency): Don't call symbol_type_set
if the type name is already correct.
* tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
--- src/symtab.c 16 Dec 2004 00:08:21 -0000 1.59
+++ src/symtab.c 12 Apr 2005 22:38:20 -0000 1.60
@@ -264,6 +264,7 @@ symbol_make_alias (symbol *sym, symbol *
abort ();
sym->number = symval->number =
(symval->number < sym->number) ? symval->number : sym->number;
+ symbol_type_set (symval, sym->type_name, loc);
}
}
@@ -283,7 +284,7 @@ symbol_check_alias_consistency (symbol *
if (!(this->alias && this->user_token_number == USER_NUMBER_ALIAS))
return;
- if (orig->type_name || alias->type_name)
+ if (orig->type_name != alias->type_name)
{
if (orig->type_name)
symbol_type_set (alias, orig->type_name, orig->type_location);
--- tests/input.at 7 Feb 2005 23:14:55 -0000 1.31
+++ tests/input.at 12 Apr 2005 22:35:53 -0000 1.32
@@ -272,3 +272,28 @@ AT_PARSER_CHECK([./input], 0,
]])
AT_CLEANUP
+
+
+## ---------------------- ##
+## Typed symbol aliases. ##
+## ---------------------- ##
+
+AT_SETUP([Typed symbol aliases])
+
+# Bison 2.0 broke typed symbol aliases - ensure they work.
+
+AT_DATA_GRAMMAR([input.y],
+[[%union
+{
+ int val;
+};
+%token <val> MY_TOKEN "MY TOKEN"
+%type <val> exp
+%%
+exp: "MY TOKEN";
+%%
+]])
+
+AT_CHECK([bison -o input.c input.y])
+
+AT_CLEANUP