From: Justin Viiret Date: Mon, 20 Jun 2016 00:37:22 +0000 (+1000) Subject: tighten ghost vertex checks X-Git-Tag: v4.3.0^2~102 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1e5fcd5e8082c53cfffdcd463ba192fb38cd9d18;p=thirdparty%2Fvectorscan.git tighten ghost vertex checks --- diff --git a/src/rose/rose_build_role_aliasing.cpp b/src/rose/rose_build_role_aliasing.cpp index cbd56b90..e3b8be2f 100644 --- a/src/rose/rose_build_role_aliasing.cpp +++ b/src/rose/rose_build_role_aliasing.cpp @@ -380,15 +380,19 @@ bool sameGhostProperties(const RoseBuildImpl &build, RoseVertex a, ghost_b.push_back(e.first); } } - if (!ghost_a.empty() || !ghost_a.empty()) { - DEBUG_PRINTF("ghost map targets\n"); - if (build.g[a].literals != build.g[b].literals) { - DEBUG_PRINTF("diff literals\n"); - return false; - } + + if (ghost_a.empty() && ghost_b.empty()) { + return true; } - return true; + if (ghost_a.empty() || ghost_b.empty()) { + DEBUG_PRINTF("only one is a ghost vertex\n"); + return false; + } + + // Both are ghost vertices: it is only safe to merge them if their literals + // are the same. + return build.g[a].literals == build.g[b].literals; } static