Skip to content

Commit 26f5b97

Browse files
committed
Avoid shadowing "message"
Just move the declarations closer to their use, and get rid of some temporaries altogether.
1 parent 8c2d7ad commit 26f5b97

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

src/goto-analyzer/taint_parser.cpp

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,6 @@ bool taint_parser(
5757
taint_parse_treet::rulet rule;
5858

5959
const std::string kind=(*it)["kind"].value;
60-
const std::string function=(*it)["function"].value;
61-
const std::string where=(*it)["where"].value;
62-
const std::string taint=(*it)["taint"].value;
63-
const std::string message=(*it)["message"].value;
64-
const std::string id=(*it)["id"].value;
6560

6661
if(kind=="source")
6762
rule.kind=taint_parse_treet::rulet::SOURCE;
@@ -78,6 +73,8 @@ bool taint_parser(
7873
return true;
7974
}
8075

76+
const std::string function = (*it)["function"].value;
77+
8178
if(function.empty())
8279
{
8380
messaget message(message_handler);
@@ -88,6 +85,8 @@ bool taint_parser(
8885
else
8986
rule.function_identifier=function;
9087

88+
const std::string where = (*it)["where"].value;
89+
9190
if(where=="return_value")
9291
{
9392
rule.where=taint_parse_treet::rulet::RETURN_VALUE;
@@ -112,9 +111,9 @@ bool taint_parser(
112111
return true;
113112
}
114113

115-
rule.taint=taint;
116-
rule.message=message;
117-
rule.id=id;
114+
rule.taint = (*it)["taint"].value;
115+
rule.message = (*it)["message"].value;
116+
rule.id = (*it)["id"].value;
118117

119118
dest.rules.push_back(rule);
120119
}

0 commit comments

Comments
 (0)