From e562dd8adff015d44bec3d7fd8e6608a3a031ff3 Mon Sep 17 00:00:00 2001 From: Denis Efremov Date: Mon, 20 Jul 2020 19:44:34 +0300 Subject: executor: fix build errors in setup_32bit_idt() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GCC10 fails to build the code with errors: executor/common_kvm_amd64.h:143:64: error: ‘gate.kvm_segment::type’ may be used uninitialized in this function [-Werror=maybe-uninitialized] executor/common_kvm_amd64.h:143:56: error: ‘gate.kvm_segment::base’ may be used uninitialized in this function [-Werror=maybe-uninitialized] Replace 'case 6' with 'case 5' since 'i % 6' results in [0..5]. Signed-off-by: Denis Efremov --- executor/common_kvm_amd64.h | 2 +- pkg/csource/generated.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/executor/common_kvm_amd64.h b/executor/common_kvm_amd64.h index 666bf5e3c..a8173b9b3 100644 --- a/executor/common_kvm_amd64.h +++ b/executor/common_kvm_amd64.h @@ -208,7 +208,7 @@ static void setup_32bit_idt(struct kvm_sregs* sregs, char* host_mem, uintptr_t g gate.type = 15; gate.base = SEL_CS32; break; - case 6: + case 5: // 32-bit task gate gate.type = 11; gate.base = SEL_TGATE32; diff --git a/pkg/csource/generated.go b/pkg/csource/generated.go index 8bc0324a9..3607b4797 100644 --- a/pkg/csource/generated.go +++ b/pkg/csource/generated.go @@ -5651,7 +5651,7 @@ static void setup_32bit_idt(struct kvm_sregs* sregs, char* host_mem, uintptr_t g gate.type = 15; gate.base = SEL_CS32; break; - case 6: + case 5: gate.type = 11; gate.base = SEL_TGATE32; break; -- cgit mrf-deployment