aboutsummaryrefslogtreecommitdiffstats
path: root/prog/encodingexec_test.go
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2018-02-25 14:44:29 +0100
committerDmitry Vyukov <dvyukov@google.com>2018-02-25 14:44:29 +0100
commit2145057cb8a50aba1a27a67be19953bee9b164fd (patch)
treea8a5b759ef44ad1a88f1bf3064283ff3caa7fc69 /prog/encodingexec_test.go
parent1f4ae3f41357cf0a8cf8c698cbcd1000b8b44bf4 (diff)
pkg/compiler: fix alignment corner case
Fix alignemnt calculation for packed structs with alignment and bitfields. Amusingly this affected only a single real struct -- ipv6_fragment_ext_header.
Diffstat (limited to 'prog/encodingexec_test.go')
-rw-r--r--prog/encodingexec_test.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/prog/encodingexec_test.go b/prog/encodingexec_test.go
index 92c36cad4..2ad19598e 100644
--- a/prog/encodingexec_test.go
+++ b/prog/encodingexec_test.go
@@ -390,6 +390,21 @@ func TestSerializeForExec(t *testing.T) {
},
nil,
},
+ {
+ "syz_test$align7(&(0x7f0000000000)={{0x1, 0x2, 0x3, 0x4, 0x5, 0x6}, 0x42})",
+ []uint64{
+ execInstrCopyin, dataOffset + 0, execArgConst, 1 | 0<<16 | 1<<24, 0x1,
+ execInstrCopyin, dataOffset + 0, execArgConst, 1 | 1<<16 | 1<<24, 0x2,
+ execInstrCopyin, dataOffset + 0, execArgConst, 1 | 2<<16 | 1<<24, 0x3,
+ execInstrCopyin, dataOffset + 1, execArgConst, 2 | 0<<16 | 1<<24, 0x4,
+ execInstrCopyin, dataOffset + 1, execArgConst, 2 | 1<<16 | 1<<24, 0x5,
+ execInstrCopyin, dataOffset + 1, execArgConst, 2 | 2<<16 | 1<<24, 0x6,
+ execInstrCopyin, dataOffset + 8, execArgConst, 1, 0x42,
+ callID("syz_test$align7"), ExecNoCopyout, 1, execArgConst, ptrSize, dataOffset,
+ execInstrEOF,
+ },
+ nil,
+ },
}
buf := make([]byte, ExecBufferSize)