From 7647422a8c5c40c41a70323631da4217e8d6fca9 Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Wed, 11 May 2011 19:41:46 -0600 Subject: [PATCH] build: silence clang false positive Clang couldn't quite see that the same condition of (flags & VIR_DOMAIN_MEM_CONFIG) is used twice, such that the second block is guaranteed that def was assigned in the first block. * src/libxl/libxl_driver.c (libxlDomainSetMemoryFlags): Add a hint for clang. --- src/libxl/libxl_driver.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index 1d41e2d9f9..b2cc0e8ace 100644 --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -1535,6 +1535,8 @@ libxlDomainSetMemoryFlags(virDomainPtr dom, unsigned long memory, ret = 0; if (flags & VIR_DOMAIN_MEM_CONFIG) { + /* clang 2.9 needs an extra hint. */ + sa_assert(def); def->mem.cur_balloon = memory; ret = virDomainSaveConfig(driver->configDir, def); } -- GitLab