traefik / yaegi

Yaegi is Another Elegant Go Interpreter
https://pkg.go.dev/github.com/traefik/yaegi
Apache License 2.0
7.02k stars 349 forks source link

interp: improve support of unsafe #1545

Closed mvertes closed 1 year ago

mvertes commented 1 year ago

Unsafe functions such as unsafe.Alignof, unsafe.Offsetof and unsafe.Sizeof can be used for type declarations early on during compile, and as such, must be treated as builtins returning constants at compile time. It is still necessary to explicitely enable unsafe support in yaegi.

The support of unsafe.Add has also been added.

Fixes #1544.