Replace own dummy syscall with standard library syscall

This makes it easier to support other standard library packages.
This commit is contained in:
Ayke van Laethem
2018-08-30 05:58:54 +02:00
parent e01259ba77
commit 906e061e37
4 changed files with 17 additions and 8 deletions
+10
View File
@@ -67,6 +67,16 @@ func (p *Program) interpret(instrs []ssa.Instruction, paramKeys []*ssa.Parameter
if callee == nil {
return i, nil // don't understand dynamic dispatch
}
if callee.String() == "syscall.runtime_envs" {
// TODO: replace this with some //go:linkname magic.
// For now, do as if it returned a zero-length slice.
var err error
locals[instr], err = p.getZeroValue(callee.Signature.Results().At(0).Type())
if err != nil {
return i, err
}
continue
}
if canInterpret(callee) {
params := make([]Value, len(common.Args))
for i, arg := range common.Args {