mirror of
https://github.com/golang/go.git
synced 2024-10-01 15:27:13 +00:00
conversion to/from
any pointer or uintptr and unsafe.pointer R=r OCL=20795 CL=20795
This commit is contained in:
parent
1d4daa2d39
commit
bf6164719a
@ -622,6 +622,22 @@ loop:
|
|||||||
goto ret;
|
goto ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// convert to unsafe.pointer
|
||||||
|
if(isptrto(n->type, TANY)) {
|
||||||
|
if(isptr[l->type->etype])
|
||||||
|
goto ret;
|
||||||
|
if(l->type->etype == TUINTPTR)
|
||||||
|
goto ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
// convert from unsafe.pointer
|
||||||
|
if(isptrto(l->type, TANY)) {
|
||||||
|
if(isptr[n->type->etype])
|
||||||
|
goto ret;
|
||||||
|
if(n->type->etype == TUINTPTR)
|
||||||
|
goto ret;
|
||||||
|
}
|
||||||
|
|
||||||
if(l->type != T)
|
if(l->type != T)
|
||||||
yyerror("cannot convert %T to %T", l->type, t);
|
yyerror("cannot convert %T to %T", l->type, t);
|
||||||
goto ret;
|
goto ret;
|
||||||
|
Loading…
Reference in New Issue
Block a user