aboutsummaryrefslogtreecommitdiff
path: root/libgo/runtime/go-unreflect.c
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/runtime/go-unreflect.c')
-rw-r--r--libgo/runtime/go-unreflect.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libgo/runtime/go-unreflect.c b/libgo/runtime/go-unreflect.c
index 8860485..c4da5fd 100644
--- a/libgo/runtime/go-unreflect.c
+++ b/libgo/runtime/go-unreflect.c
@@ -5,6 +5,7 @@
license that can be found in the LICENSE file. */
#include "go-alloc.h"
+#include "go-panic.h"
#include "go-type.h"
#include "interface.h"
@@ -19,6 +20,9 @@ Unreflect (struct __go_empty_interface type, void *object)
{
struct __go_empty_interface ret;
+ if (((uintptr_t) type.__type_descriptor & reflectFlags) != 0)
+ __go_panic_msg ("invalid interface value");
+
/* FIXME: We should check __type_descriptor to verify that this is
really a type descriptor. */
ret.__type_descriptor = type.__object;