From 2b09fa14e1072fe218cb639630eb85f302c3ffc6 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Wed, 29 Jul 2020 18:55:04 +0100 Subject: [PATCH] Disallow using reserved identifiers in Yul --- libyul/AsmAnalysis.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libyul/AsmAnalysis.cpp b/libyul/AsmAnalysis.cpp index b6eba1119..90a4f4cd7 100644 --- a/libyul/AsmAnalysis.cpp +++ b/libyul/AsmAnalysis.cpp @@ -570,6 +570,12 @@ void AsmAnalyzer::expectValidIdentifier(YulString _identifier, SourceLocation co "\"" + _identifier.str() + "\" is not a valid identifier (contains consecutive dots)." ); + if (m_dialect.reservedIdentifier(_identifier)) + m_errorReporter.declarationError( + 5017_error, + _location, + "The identifier \"" + _identifier.str() + "\" is reserved and can not be used." + ); } void AsmAnalyzer::expectValidType(YulString _type, SourceLocation const& _location)