update sys.reflect and sys.unreflect to accomodate
the possibility of large objects in interface values.
R=r
DELTA=171 (97 added, 22 deleted, 52 changed)
OCL=22382
CL=22382
diff --git a/src/lib/reflect/all_test.go b/src/lib/reflect/all_test.go
index eb0bbf9..38e2589 100644
--- a/src/lib/reflect/all_test.go
+++ b/src/lib/reflect/all_test.go
@@ -332,3 +332,24 @@
}
}
}
+
+export func TestBigUnnamedStruct(t *testing.T) {
+ b := struct{a,b,c,d int64}{1, 2, 3, 4};
+ v := NewValue(b);
+ b1 := v.Interface().(struct{a,b,c,d int64});
+ if b1.a != b.a || b1.b != b.b || b1.c != b.c || b1.d != b.d {
+ t.Errorf("NewValue(%v).Interface().(Big) = %v", b, b1);
+ }
+}
+
+type Big struct {
+ a, b, c, d, e int64
+}
+export func TestBigStruct(t *testing.T) {
+ b := Big{1, 2, 3, 4, 5};
+ v := NewValue(b);
+ b1 := v.Interface().(Big);
+ if b1.a != b.a || b1.b != b.b || b1.c != b.c || b1.d != b.d || b1.e != b.e {
+ t.Errorf("NewValue(%v).Interface().(Big) = %v", b, b1);
+ }
+}