runtime: Drop reflectFlags tests.
The flags were used by the reflect package in the past, but not for a couple of years now. From-SVN: r212446
This commit is contained in:
parent
cb40eec03a
commit
2802d48b30
@ -19,10 +19,6 @@ __go_empty_interface_compare (struct __go_empty_interface left,
|
||||
|
||||
left_descriptor = left.__type_descriptor;
|
||||
|
||||
if (((uintptr_t) left_descriptor & reflectFlags) != 0
|
||||
|| ((uintptr_t) right.__type_descriptor & reflectFlags) != 0)
|
||||
runtime_panicstring ("invalid interface value");
|
||||
|
||||
if (left_descriptor == NULL && right.__type_descriptor == NULL)
|
||||
return 0;
|
||||
if (left_descriptor == NULL || right.__type_descriptor == NULL)
|
||||
|
@ -20,8 +20,6 @@ __go_empty_interface_value_compare (
|
||||
const struct __go_type_descriptor *left_descriptor;
|
||||
|
||||
left_descriptor = left.__type_descriptor;
|
||||
if (((uintptr_t) left_descriptor & reflectFlags) != 0)
|
||||
runtime_panicstring ("invalid interface value");
|
||||
if (left_descriptor == NULL)
|
||||
return 1;
|
||||
if (!__go_type_descriptors_equal (left_descriptor, right_descriptor))
|
||||
|
@ -18,8 +18,6 @@ __go_interface_empty_compare (struct __go_interface left,
|
||||
{
|
||||
const struct __go_type_descriptor *left_descriptor;
|
||||
|
||||
if (((uintptr_t) right.__type_descriptor & reflectFlags) != 0)
|
||||
runtime_panicstring ("invalid interface value");
|
||||
if (left.__methods == NULL && right.__type_descriptor == NULL)
|
||||
return 0;
|
||||
if (left.__methods == NULL || right.__type_descriptor == NULL)
|
||||
|
@ -44,9 +44,6 @@ __go_type_equal_empty_interface (const void *vv1, const void *vv2,
|
||||
v2 = (const struct __go_empty_interface *) vv2;
|
||||
v1_descriptor = v1->__type_descriptor;
|
||||
v2_descriptor = v2->__type_descriptor;
|
||||
if (((uintptr_t) v1_descriptor & reflectFlags) != 0
|
||||
|| ((uintptr_t) v2_descriptor & reflectFlags) != 0)
|
||||
runtime_panicstring ("invalid interface value");
|
||||
if (v1_descriptor == NULL || v2_descriptor == NULL)
|
||||
return v1_descriptor == v2_descriptor;
|
||||
if (!__go_type_descriptors_equal (v1_descriptor, v2_descriptor))
|
||||
|
@ -302,15 +302,6 @@ struct __go_struct_type
|
||||
struct __go_open_array __fields;
|
||||
};
|
||||
|
||||
/* If an empty interface has these bits set in its type pointer, it
|
||||
was copied from a reflect.Value and is not a valid empty
|
||||
interface. */
|
||||
|
||||
enum
|
||||
{
|
||||
reflectFlags = 3,
|
||||
};
|
||||
|
||||
/* Whether a type descriptor is a pointer. */
|
||||
|
||||
static inline _Bool
|
||||
|
@ -32,8 +32,6 @@ func ifacetype(i interface) (d *const_descriptor) {
|
||||
|
||||
// Convert an empty interface to an empty interface.
|
||||
func ifaceE2E2(e empty_interface) (ret empty_interface, ok bool) {
|
||||
if(((uintptr_t)e.__type_descriptor&reflectFlags) != 0)
|
||||
runtime_panicstring("invalid interface value");
|
||||
ret = e;
|
||||
ok = ret.__type_descriptor != nil;
|
||||
}
|
||||
@ -53,8 +51,6 @@ func ifaceI2E2(i interface) (ret empty_interface, ok bool) {
|
||||
|
||||
// Convert an empty interface to a non-empty interface.
|
||||
func ifaceE2I2(inter *descriptor, e empty_interface) (ret interface, ok bool) {
|
||||
if(((uintptr_t)e.__type_descriptor&reflectFlags) != 0)
|
||||
runtime_panicstring("invalid interface value");
|
||||
if (e.__type_descriptor == nil) {
|
||||
ret.__methods = nil;
|
||||
ret.__object = nil;
|
||||
@ -84,8 +80,6 @@ func ifaceI2I2(inter *descriptor, i interface) (ret interface, ok bool) {
|
||||
|
||||
// Convert an empty interface to a pointer type.
|
||||
func ifaceE2T2P(inter *descriptor, e empty_interface) (ret *void, ok bool) {
|
||||
if(((uintptr_t)e.__type_descriptor&reflectFlags) != 0)
|
||||
runtime_panicstring("invalid interface value");
|
||||
if (!__go_type_descriptors_equal(inter, e.__type_descriptor)) {
|
||||
ret = nil;
|
||||
ok = 0;
|
||||
@ -109,8 +103,6 @@ func ifaceI2T2P(inter *descriptor, i interface) (ret *void, ok bool) {
|
||||
|
||||
// Convert an empty interface to a non-pointer type.
|
||||
func ifaceE2T2(inter *descriptor, e empty_interface, ret *void) (ok bool) {
|
||||
if(((uintptr_t)e.__type_descriptor&reflectFlags) != 0)
|
||||
runtime_panicstring("invalid interface value");
|
||||
if (!__go_type_descriptors_equal(inter, e.__type_descriptor)) {
|
||||
__builtin_memset(ret, 0, inter->__size);
|
||||
ok = 0;
|
||||
|
@ -12,8 +12,6 @@ func ifaceE2I(inter *Type, e Eface, ret *Iface) {
|
||||
const Type *t;
|
||||
Eface err;
|
||||
|
||||
if(((uintptr)e.__type_descriptor&reflectFlags) != 0)
|
||||
runtime_throw("invalid interface value");
|
||||
t = e.__type_descriptor;
|
||||
if(t == nil) {
|
||||
// explicit conversions require non-nil interface value.
|
||||
|
Loading…
x
Reference in New Issue
Block a user