OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libgo/] [runtime/] [reflect.goc] - Blame information for rev 801

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 747 jeremybenn
// Copyright 2010 The Go Authors. All rights reserved.
2
// Use of this source code is governed by a BSD-style
3
// license that can be found in the LICENSE file.
4
 
5
package reflect
6
#include "go-type.h"
7
#include "interface.h"
8
#include "runtime.h"
9
#include "go-panic.h"
10
 
11
func ifaceE2I(inter *Type, e Eface, ret *Iface) {
12
        const Type *t;
13
        Eface err;
14
 
15
        if(((uintptr)e.__type_descriptor&reflectFlags) != 0)
16
                runtime_throw("invalid interface value");
17
        t = e.__type_descriptor;
18
        if(t == nil) {
19
                // explicit conversions require non-nil interface value.
20
                newTypeAssertionError(nil, nil, inter,
21
                        nil, nil, inter->__reflection,
22
                        nil, &err);
23
                __go_panic(err);
24
        }
25
        ret->__object = e.__object;
26
        ret->__methods = __go_convert_interface(inter, t);
27
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.