Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(934)

Side by Side Diff: src/pkg/exp/ssa/interp/external_unix.go

Issue 7313062: code review 7313062: exp/ssa/interp: (#6 of 5): test interpretation of SSA f... (Closed)
Patch Set: diff -r 019c1c8930bc https://code.google.com/p/go/ Created 12 years ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/pkg/exp/ssa/interp/external.go ('k') | src/pkg/exp/ssa/interp/external_windows.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Go Authors. All rights reserved. 1 // Copyright 2013 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 // +build !windows,!plan9 5 // +build !windows,!plan9
6 6
7 package interp 7 package interp
8 8
9 import ( 9 import (
10 "exp/ssa" 10 "exp/ssa"
11 "syscall" 11 "syscall"
12 ) 12 )
13 13
14 func ext۰syscall۰Kill(fn *ssa.Function, args []value, slots []value) value { 14 func ext۰syscall۰Kill(fn *ssa.Function, args []value) value {
15 // We could emulate syscall.Syscall but it's more effort. 15 // We could emulate syscall.Syscall but it's more effort.
16 err := syscall.Kill(args[0].(int), syscall.Signal(args[1].(int))) 16 err := syscall.Kill(args[0].(int), syscall.Signal(args[1].(int)))
17 err = err // TODO(adonovan): fix: adapt concrete err to interpreted ifac e (e.g. call interpreted errors.New) 17 err = err // TODO(adonovan): fix: adapt concrete err to interpreted ifac e (e.g. call interpreted errors.New)
18 return iface{} 18 return iface{}
19 } 19 }
20 20
21 func ext۰syscall۰Write(fn *ssa.Function, args []value, slots []value) value { 21 func ext۰syscall۰Write(fn *ssa.Function, args []value) value {
22 // We could emulate syscall.Syscall but it's more effort. 22 // We could emulate syscall.Syscall but it's more effort.
23 p := args[1].([]value) 23 p := args[1].([]value)
24 b := make([]byte, 0, len(p)) 24 b := make([]byte, 0, len(p))
25 for i := range p { 25 for i := range p {
26 b = append(b, p[i].(byte)) 26 b = append(b, p[i].(byte))
27 } 27 }
28 n, _ := syscall.Write(args[0].(int), b) 28 n, _ := syscall.Write(args[0].(int), b)
29 err := iface{} // TODO(adonovan): fix: adapt concrete err to interpreted iface. 29 err := iface{} // TODO(adonovan): fix: adapt concrete err to interpreted iface.
30 return tuple{n, err} 30 return tuple{n, err}
31 31
32 } 32 }
OLDNEW
« no previous file with comments | « src/pkg/exp/ssa/interp/external.go ('k') | src/pkg/exp/ssa/interp/external_windows.go » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b