aboutsummaryrefslogtreecommitdiffstats
path: root/prog/encodingexec.go
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2015-12-23 19:58:15 +0100
committerDmitry Vyukov <dvyukov@google.com>2015-12-23 19:58:15 +0100
commit58509c75a2a2d472855da0683c36d7ef2f1a6c97 (patch)
tree01a5a400dc703bac7b8003aa2344ba36b24beb96 /prog/encodingexec.go
parent078517990325cd52828f3ba2d74ced12fc412db8 (diff)
prog: remove padding checking
So far it has found only false positives. Let's leave this to KMSAN.
Diffstat (limited to 'prog/encodingexec.go')
-rw-r--r--prog/encodingexec.go31
1 files changed, 8 insertions, 23 deletions
diff --git a/prog/encodingexec.go b/prog/encodingexec.go
index 7c75eccc9..3b0d4c28c 100644
--- a/prog/encodingexec.go
+++ b/prog/encodingexec.go
@@ -14,8 +14,6 @@ const (
ExecInstrEOF = ^uintptr(iota)
ExecInstrCopyin
ExecInstrCopyout
- ExecInstrSetPad
- ExecInstrCheckPad
)
const (
@@ -59,20 +57,16 @@ func (p *Prog) SerializeForExec() []byte {
}
return
}
+ if pad, _ := arg1.IsPad(); pad {
+ return
+ }
if arg1.Kind == ArgData && len(arg1.Data) == 0 {
return
}
- pad, padSize := arg1.IsPad()
- if (arg1.Dir == DirIn && !pad) || (arg1.Dir == DirOut && pad) || arg1.Dir == DirInOut {
- if pad {
- w.write(ExecInstrSetPad)
- w.write(physicalAddr(arg) + w.args[arg1].Offset)
- w.write(padSize)
- } else {
- w.write(ExecInstrCopyin)
- w.write(physicalAddr(arg) + w.args[arg1].Offset)
- w.writeArg(arg1)
- }
+ if arg1.Dir != DirOut {
+ w.write(ExecInstrCopyin)
+ w.write(physicalAddr(arg) + w.args[arg1].Offset)
+ w.writeArg(arg1)
instrSeq++
}
}
@@ -89,16 +83,7 @@ func (p *Prog) SerializeForExec() []byte {
instrSeq++
// Generate copyout instructions that persist interesting return values.
foreachArg(c, func(arg, base *Arg, _ *[]*Arg) {
- pad, padSize := arg.IsPad()
- if pad && arg.Dir != DirIn {
- instrSeq++
- info := w.args[arg]
- w.write(ExecInstrCheckPad)
- w.write(physicalAddr(base) + info.Offset)
- w.write(padSize)
- return
- }
- if pad || len(arg.Uses) == 0 {
+ if len(arg.Uses) == 0 {
return
}
switch arg.Kind {