tinygo/src
Ayke van Laethem f800f7507c reflect: check for access in the Interface method call
This fixes a type system loophole. The following program would
incorrectly run in TinyGo, while it would trigger a panic in Go:

    package main

    import "reflect"

    func main() {
        v := reflect.ValueOf(struct {
            x int
        }{})
        x := v.Field(0).Interface()
        println("x:", x.(int))
    }

Playground link: https://play.golang.org/p/nvvA18XFqFC

The panic in Go is the following:

    panic: reflect.Value.Interface: cannot return value obtained from unexported field or method

I've shortened it in TinyGo to save a little bit of space.
2021-03-24 12:19:16 +01:00
..
device stm32: use stm32-rs SVDs which are of much higher quality 2021-01-09 21:45:07 +01:00
examples accept configuration struct for ADC parameters (#1533) 2021-01-31 14:54:27 -06:00
internal compiler: merge runtime.typecodeID and runtime.typeInInterface 2021-03-23 14:32:33 +01:00
machine stm32: i2c implementation for F7, L5 and L4 MCUs 2021-03-24 08:35:34 +01:00
os WASI & darwin: support env variables based on libc 2021-02-24 14:22:17 +01:00
reflect reflect: check for access in the Interface method call 2021-03-24 12:19:16 +01:00
runtime reflect: check for access in the Interface method call 2021-03-24 12:19:16 +01:00
sync extend stdlib to allow import of more packages (#1099) 2020-06-23 11:56:28 +02:00
syscall WASI & darwin: support env variables based on libc 2021-02-24 14:22:17 +01:00
testing testing: add Run method 2020-10-28 18:25:56 +01:00