summaryrefslogtreecommitdiff
path: root/src/pkg/runtime/iface.c
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2009-07-10 16:32:26 -0700
committerRuss Cox <rsc@golang.org>2009-07-10 16:32:26 -0700
commit46107393871d509a80c59db5a85ad809bf86e344 (patch)
tree3698f9e33adedb89891bcc4a66cfa3e5007115bd /src/pkg/runtime/iface.c
parente50357b398dc17f13b212c3d55cde6497086b262 (diff)
downloadgo-46107393871d509a80c59db5a85ad809bf86e344.tar.gz
reflection for interface set
rename map access methods to Elem, SetElem. R=r DELTA=95 (66 added, 7 deleted, 22 changed) OCL=31456 CL=31469
Diffstat (limited to 'src/pkg/runtime/iface.c')
-rw-r--r--src/pkg/runtime/iface.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/pkg/runtime/iface.c b/src/pkg/runtime/iface.c
index cc9eb7eed..63093ad88 100644
--- a/src/pkg/runtime/iface.c
+++ b/src/pkg/runtime/iface.c
@@ -379,7 +379,7 @@ sys·ifaceI2I2(InterfaceType *inter, Iface i, Iface ret, bool ok)
// ifaceE2I(sigi *byte, iface any) (ret any);
// Called only for explicit conversions (with type assertion).
void
-sys·ifaceE2I(InterfaceType *inter, Eface e, Iface ret)
+ifaceE2I(InterfaceType *inter, Eface e, Iface *ret)
{
Type *t;
@@ -389,10 +389,17 @@ sys·ifaceE2I(InterfaceType *inter, Eface e, Iface ret)
printf("interface is nil, not %S\n", *inter->string);
throw("interface conversion");
} else {
- ret.data = e.data;
- ret.tab = itab(inter, t, 0);
+ ret->data = e.data;
+ ret->tab = itab(inter, t, 0);
}
- FLUSH(&ret);
+}
+
+// ifaceE2I(sigi *byte, iface any) (ret any);
+// Called only for explicit conversions (with type assertion).
+void
+sys·ifaceE2I(InterfaceType *inter, Eface e, Iface ret)
+{
+ ifaceE2I(inter, e, &ret);
}
// ifaceE2I2(sigi *byte, iface any) (ret any, ok bool);
@@ -618,4 +625,3 @@ unsafe·Unreflect(Iface typ, void *addr, Eface e)
FLUSH(&e);
}
-