@@ -1116,7 +1116,7 @@ namespace yy {
11161116#line 316 "seclang-parser.yy" // lalr1.cc:788
11171117{
11181118 // Initialize the initial location.
1119- yyla.location .begin .filename = yyla.location .end .filename = & driver.file ;
1119+ yyla.location .begin .filename = yyla.location .end .filename = new std::string ( driver.file ) ;
11201120}
11211121
11221122#line 1123 "seclang-parser.cc" // lalr1.cc:788
@@ -1707,7 +1707,7 @@ namespace yy {
17071707 {
17081708 yylhs.value .as < std::unique_ptr<Operator> > () = std::move (yystack_[0 ].value .as < std::unique_ptr<Operator> > ());
17091709 std::string error;
1710- if (yylhs.value .as < std::unique_ptr<Operator> > ()->init (driver. ref . back () , &error) == false ) {
1710+ if (yylhs.value .as < std::unique_ptr<Operator> > ()->init (*yystack_[ 0 ]. location . end . filename , &error) == false ) {
17111711 driver.error (yystack_[1 ].location , error);
17121712 YYERROR;
17131713 }
@@ -1721,7 +1721,7 @@ namespace yy {
17211721 yylhs.value .as < std::unique_ptr<Operator> > () = std::move (yystack_[0 ].value .as < std::unique_ptr<Operator> > ());
17221722 yylhs.value .as < std::unique_ptr<Operator> > ()->m_negation = true ;
17231723 std::string error;
1724- if (yylhs.value .as < std::unique_ptr<Operator> > ()->init (driver. ref . back () , &error) == false ) {
1724+ if (yylhs.value .as < std::unique_ptr<Operator> > ()->init (*yystack_[ 1 ]. location . end . filename , &error) == false ) {
17251725 driver.error (yystack_[2 ].location , error);
17261726 YYERROR;
17271727 }
@@ -1734,7 +1734,7 @@ namespace yy {
17341734 {
17351735 OPERATOR_CONTAINER (yylhs.value .as < std::unique_ptr<Operator> > (), new operators::Rx (std::move (yystack_[0 ].value .as < std::unique_ptr<RunTimeString> > ())));
17361736 std::string error;
1737- if (yylhs.value .as < std::unique_ptr<Operator> > ()->init (driver. ref . back () , &error) == false ) {
1737+ if (yylhs.value .as < std::unique_ptr<Operator> > ()->init (*yystack_[ 0 ]. location . end . filename , &error) == false ) {
17381738 driver.error (yystack_[1 ].location , error);
17391739 YYERROR;
17401740 }
@@ -1748,7 +1748,7 @@ namespace yy {
17481748 OPERATOR_CONTAINER (yylhs.value .as < std::unique_ptr<Operator> > (), new operators::Rx (std::move (yystack_[0 ].value .as < std::unique_ptr<RunTimeString> > ())));
17491749 yylhs.value .as < std::unique_ptr<Operator> > ()->m_negation = true ;
17501750 std::string error;
1751- if (yylhs.value .as < std::unique_ptr<Operator> > ()->init (driver. ref . back () , &error) == false ) {
1751+ if (yylhs.value .as < std::unique_ptr<Operator> > ()->init (*yystack_[ 1 ]. location . end . filename , &error) == false ) {
17521752 driver.error (yystack_[2 ].location , error);
17531753 YYERROR;
17541754 }
@@ -2063,7 +2063,7 @@ namespace yy {
20632063 /* op */ op,
20642064 /* variables */ v,
20652065 /* actions */ a,
2066- /* file name */ driver. ref . back () ,
2066+ /* file name */ *yystack_[ 3 ]. location . end . filename ,
20672067 /* line number */ yystack_[3 ].location .end .line
20682068 );
20692069
@@ -2087,7 +2087,7 @@ namespace yy {
20872087 /* op */ yystack_[0 ].value .as < std::unique_ptr<Operator> > ().release (),
20882088 /* variables */ v,
20892089 /* actions */ NULL ,
2090- /* file name */ driver. ref . back () ,
2090+ /* file name */ *yystack_[ 2 ]. location . end . filename ,
20912091 /* line number */ yystack_[2 ].location .end .line
20922092 );
20932093 if (driver.addSecRule (rule) == false ) {
@@ -2109,7 +2109,7 @@ namespace yy {
21092109 /* op */ NULL ,
21102110 /* variables */ NULL ,
21112111 /* actions */ a,
2112- /* file name */ driver. ref . back () ,
2112+ /* file name */ *yystack_[ 1 ]. location . end . filename ,
21132113 /* line number */ yystack_[1 ].location .end .line
21142114 );
21152115 driver.addSecAction (rule);
@@ -2128,7 +2128,7 @@ namespace yy {
21282128 RuleScript *r = new RuleScript (
21292129 /* path to script */ yystack_[1 ].value .as < std::string > (),
21302130 /* actions */ a,
2131- /* file name */ driver. ref . back () ,
2131+ /* file name */ *yystack_[ 1 ]. location . end . filename ,
21322132 /* line number */ yystack_[1 ].location .end .line
21332133 );
21342134
@@ -2721,7 +2721,7 @@ namespace yy {
27212721#if defined(WITH_GEOIP) or defined(WITH_MAXMIND)
27222722 std::string err;
27232723 std::string file = modsecurity::utils::find_resource (yystack_[0 ].value .as < std::string > (),
2724- driver. ref . back () , &err);
2724+ *yystack_[ 0 ]. location . end . filename , &err);
27252725 if (file.empty ()) {
27262726 std::stringstream ss;
27272727 ss << " Failed to load locate the GeoDB file from: " << yystack_[0 ].value .as < std::string > () << " " ;
@@ -2949,7 +2949,7 @@ namespace yy {
29492949 param.pop_back ();
29502950 }
29512951
2952- file = modsecurity::utils::find_resource (f, driver. ref . back () , &err);
2952+ file = modsecurity::utils::find_resource (f, *yystack_[ 0 ]. location . end . filename , &err);
29532953 if (file.empty ()) {
29542954 std::stringstream ss;
29552955 ss << " Failed to locate the unicode map file from: " << f << " " ;
0 commit comments