Commit 5918f80f authored by Ken Thompson's avatar Ken Thompson

bug31

failed to correctly convert from pointer
to interface in a return statement.

moved ANY from a special type in
chan/map to a basic type.

SVN=114350
parent c69d54e7
......@@ -967,7 +967,7 @@ cgen_ret(Node *n)
genconv(f->type, arg->type);
gopcode(PLOAD, PTADDR, a->nname);
gopcode(PADDO, PTADDR, f->nname);
gopcodet(PSTOREI, arg->type, N);
gopcodet(PSTOREI, f->type, N);
}
arg = listnext(&save);
f = f->down;
......
......@@ -227,7 +227,7 @@ enum
TINTER,
TFORW,
TFIELD,
TPOLY,
TANY,
TSTRING,
NTYPE,
......
......@@ -37,8 +37,7 @@
%type <node> simple_stmt osimple_stmt
%type <node> expr uexpr pexpr expr_list oexpr oexpr_list expr_list_r
%type <node> name name_name new_name new_name_list_r
%type <node> type polytype
%type <node> new_type
%type <node> type new_type
%type <node> vardcl_list_r vardcl
%type <node> constdcl_list_r constdcl
%type <node> typedcl_list_r typedcl
......@@ -750,14 +749,14 @@ type:
{
$$ = aindex($2, $4);
}
| LCHAN chantype polytype
| LCHAN chantype type
{
$$ = nod(OTYPE, N, N);
$$->etype = TCHAN;
$$->type = $3;
$$->chan = $2;
}
| LMAP '[' type ']' polytype
| LMAP '[' type ']' type
{
$$ = nod(OTYPE, N, N);
$$->etype = TMAP;
......@@ -781,6 +780,11 @@ type:
{
$$ = dostruct(N, TINTER);
}
| LANY
{
$$ = nod(OTYPE, N, N);
$$->etype = TANY;
}
| fntypeh
| '*' type
{
......@@ -794,14 +798,6 @@ type:
$$ = forwdcl($2);
}
polytype:
type
| LANY
{
$$ = nod(OTYPE, N, N);
$$->etype = TPOLY;
}
chantype:
{
$$ = Cboth;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment