Adds reference to filename and line number to lexer errors

This commit is contained in:
Felipe Zimmerle
2015-09-30 14:35:08 -03:00
parent 900af2cd48
commit 8255ce86ca
5 changed files with 45 additions and 12 deletions

View File

@@ -68,6 +68,16 @@ Phase::Phase(std::string action)
}
}
bool Phase::init(std::string *error) {
if (phase >= ModSecurity::Phases::NUMBER_OF_PHASES) {
error->assign("Unknown phase: " + std::to_string(phase));
return false;
}
return true;
}
bool Phase::evaluate(Rule *rule, Assay *assay) {
rule->phase = this->phase;
return true;

View File

@@ -34,6 +34,7 @@ class Phase : public Action {
public:
explicit Phase(std::string action);
bool init(std::string *error) override;
bool evaluate(Rule *rule, Assay *assay) override;
int phase;
int m_secRulesPhase;