From 4cf9ea4e68268f45e0abcb0a5c0e63c91517b2ee Mon Sep 17 00:00:00 2001 From: Alex Antonov Date: Mon, 18 Oct 2021 15:58:22 +0300 Subject: [PATCH] [mapleall][bugfix] Fix duplicated entry name in different enums enum OptionEnum and enum OptionIndex contain the same entry name - kInsertCall. It leads to a bug during option solving in CGOptions::SolveOptions. This method must check OptionIndex:kInsertCall and set OptionEnum:kGenInsertCall. --- src/mapleall/maple_be/include/cg/cg_option.h | 4 ++-- src/mapleall/maple_be/src/cg/cg_option.cpp | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/mapleall/maple_be/include/cg/cg_option.h b/src/mapleall/maple_be/include/cg/cg_option.h index a511d3854c..ab507c4394 100644 --- a/src/mapleall/maple_be/include/cg/cg_option.h +++ b/src/mapleall/maple_be/include/cg/cg_option.h @@ -40,7 +40,7 @@ class CGOptions : public MapleDriverOptionBase { kGenPic = 1ULL << 4, kGenPie = 1ULL << 5, kVerboseAsm = 1ULL << 6, - kInsertCall = 1ULL << 7, + kGenInsertCall = 1ULL << 7, kAddDebugTrace = 1ULL << 8, kGenYieldPoint = 1ULL << 9, kGenLocalRc = 1ULL << 10, @@ -239,7 +239,7 @@ class CGOptions : public MapleDriverOptionBase { } bool NeedInsertInstrumentationFunction() const { - return (options & kInsertCall) != 0; + return (options & kGenInsertCall) != 0; } bool InstrumentWithDebugTraceCall() const { diff --git a/src/mapleall/maple_be/src/cg/cg_option.cpp b/src/mapleall/maple_be/src/cg/cg_option.cpp index 516b0a53d4..ed3e922e98 100644 --- a/src/mapleall/maple_be/src/cg/cg_option.cpp +++ b/src/mapleall/maple_be/src/cg/cg_option.cpp @@ -1213,6 +1213,7 @@ bool CGOptions::SolveOptions(const std::vector