File tree Expand file tree Collapse file tree 5 files changed +7
-9
lines changed Expand file tree Collapse file tree 5 files changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -153,7 +153,7 @@ class Functionalizer
153
153
return ;
154
154
m_out << m_prefix << " /*" ;
155
155
if (m_location.sourceName )
156
- m_out << " " + escapeAndQuoteYulString (*m_location.sourceName );
156
+ m_out << " " + escapeAndQuoteString (*m_location.sourceName );
157
157
if (m_location.hasText ())
158
158
m_out << " :" << to_string (m_location.start ) + " :" + to_string (m_location.end );
159
159
m_out << " " << locationFromSources (m_sourceCodes, m_location);
Original file line number Diff line number Diff line change @@ -3166,5 +3166,5 @@ bool IRGeneratorForStatements::visit(TryCatchClause const& _clause)
3166
3166
string IRGeneratorForStatements::linkerSymbol (ContractDefinition const & _library) const
3167
3167
{
3168
3168
solAssert (_library.isLibrary (), " " );
3169
- return " linkersymbol(" + util::escapeAndQuoteYulString (_library.fullyQualifiedName ()) + " )" ;
3169
+ return " linkersymbol(" + util::escapeAndQuoteString (_library.fullyQualifiedName ()) + " )" ;
3170
3170
}
Original file line number Diff line number Diff line change @@ -192,13 +192,11 @@ string solidity::util::formatAsStringOrNumber(string const& _value)
192
192
if (c <= 0x1f || c >= 0x7f || c == ' "' )
193
193
return " 0x" + h256 (_value, h256::AlignLeft).hex ();
194
194
195
- // The difference in escaping is only in characters below 0x1f and the string does not have them
196
- // so this will work for Solidity strings too.
197
- return escapeAndQuoteYulString (_value);
195
+ return escapeAndQuoteString (_value);
198
196
}
199
197
200
198
201
- string solidity::util::escapeAndQuoteYulString (string const & _input)
199
+ string solidity::util::escapeAndQuoteString (string const & _input)
202
200
{
203
201
string out;
204
202
Original file line number Diff line number Diff line change @@ -552,9 +552,9 @@ bool isValidDecimal(std::string const& _string);
552
552
// / _value cannot be longer than 32 bytes.
553
553
std::string formatAsStringOrNumber (std::string const & _value);
554
554
555
- // / @returns a string with the usual backslash-escapes for non-ASCII
555
+ // / @returns a string with the usual backslash-escapes for non-printable and non- ASCII
556
556
// / characters and surrounded by '"'-characters.
557
- std::string escapeAndQuoteYulString (std::string const & _input);
557
+ std::string escapeAndQuoteString (std::string const & _input);
558
558
559
559
template <typename Container, typename Compare>
560
560
bool containerEqual (Container const & _lhs, Container const & _rhs, Compare&& _compare)
Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ string AsmPrinter::operator()(Literal const& _literal) const
57
57
break ;
58
58
}
59
59
60
- return escapeAndQuoteYulString (_literal.value .str ()) + appendTypeName (_literal.type );
60
+ return escapeAndQuoteString (_literal.value .str ()) + appendTypeName (_literal.type );
61
61
}
62
62
63
63
string AsmPrinter::operator ()(Identifier const & _identifier) const
You can’t perform that action at this time.
0 commit comments