diff options
author | Michael Forney <mforney@mforney.org> | 2019-04-18 12:11:01 -0700 |
---|---|---|
committer | Michael Forney <mforney@mforney.org> | 2019-04-18 12:12:12 -0700 |
commit | 1712e38057b824f79002011f0ca074b802f9b953 (patch) | |
tree | e955abec236950475c81ce558ec91bdc23d0510b /test | |
parent | c683dbd6e4da3a6aba22779c99810f8684c38208 (diff) | |
download | cproc-1712e38057b824f79002011f0ca074b802f9b953.tar.xz |
Fix potential overflow of bit-field initializers into following member
Fixes #46. Thanks to Andrew Chambers for the bug report.
Diffstat (limited to 'test')
-rw-r--r-- | test/bitfield-initializer-overflow.c | 3 | ||||
-rw-r--r-- | test/bitfield-initializer-overflow.qbe | 1 |
2 files changed, 4 insertions, 0 deletions
diff --git a/test/bitfield-initializer-overflow.c b/test/bitfield-initializer-overflow.c new file mode 100644 index 0000000..54de7c9 --- /dev/null +++ b/test/bitfield-initializer-overflow.c @@ -0,0 +1,3 @@ +struct { + unsigned : 30, a : 2, b; +} s = {5}; diff --git a/test/bitfield-initializer-overflow.qbe b/test/bitfield-initializer-overflow.qbe new file mode 100644 index 0000000..be0a065 --- /dev/null +++ b/test/bitfield-initializer-overflow.qbe @@ -0,0 +1 @@ +export data $s = align 4 { z 3, b 64, z 4 } |