tools/kdd: work around gcc 8.1 bug

Gcc 8.1 has a bug that causes kdd fail to build. Rewrite the code to
work around that bug.

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86827

Signed-off-by: Tim Deegan <tim@xen.org>
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Tested-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
This commit is contained in:
Wei Liu committed 2018-08-20 11:49:46 +01:00
1 parent e75c9dc85f
commit 48a70499e6
1 file changed
+4 -5
+4 -5
View File
@@ -687,11 +687,10 @@ static void kdd_handle_read_ctrl(kdd_state *s)
}
} else {
/* 32-bit control-register space starts at 0x[2]cc, for 84 bytes */
uint32_t offset = addr;
if (offset > 0x200)
offset -= 0x200;
offset -= 0xcc;
if (offset > sizeof ctrl.c32 || offset + len > sizeof ctrl.c32) {
uint32_t offset = addr - 0xcc;
if (offset > sizeof ctrl.c32)
offset -= 0x2cc;
if (offset > sizeof ctrl.c32 || len > sizeof ctrl.c32 - offset) {
KDD_LOG(s, "Request outside of known control space\n");
len = 0;
} else {
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.