robs bug converting unsafe.pointer

R=r
OCL=20834
CL=20834
This commit is contained in:
Ken Thompson 2008-12-09 13:00:50 -08:00
parent 0d9c1abb58
commit 92a1190c6c
2 changed files with 8 additions and 0 deletions

View File

@ -156,6 +156,7 @@ struct Type
uchar embedded; // TFIELD embedded type
uchar siggen;
uchar funarg;
uchar copyany;
// TFUNCT
uchar thistuple;

View File

@ -1779,6 +1779,8 @@ loop:
goto loop;
case TANY:
if(!st->copyany)
return 0;
*stp = t;
break;
@ -1841,6 +1843,11 @@ deep(Type *t)
nt = t; // share from here down
break;
case TANY:
nt = shallow(t);
nt->copyany = 1;
break;
case TPTR32:
case TPTR64:
case TCHAN: