1
0
mirror of https://github.com/golang/go synced 2024-11-23 00:30:07 -07:00

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 embedded; // TFIELD embedded type
uchar siggen; uchar siggen;
uchar funarg; uchar funarg;
uchar copyany;
// TFUNCT // TFUNCT
uchar thistuple; uchar thistuple;

View File

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